Update frontend to use new SPLC.get()
This commit is contained in:
parent
89346aa76b
commit
34ebdaf8de
@ -1343,8 +1343,8 @@ class MpdFrontend(object):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return ['file: %s' % t.uri
|
return ['file: %s' % t.uri
|
||||||
for t in self.backend.stored_playlists.get_by_name(name).tracks]
|
for t in self.backend.stored_playlists.get(name=name).tracks]
|
||||||
except KeyError as e:
|
except LookupError as e:
|
||||||
raise MpdAckError(e[0])
|
raise MpdAckError(e[0])
|
||||||
|
|
||||||
@handle_pattern(r'^listplaylistinfo "(?P<name>[^"]+)"$')
|
@handle_pattern(r'^listplaylistinfo "(?P<name>[^"]+)"$')
|
||||||
@ -1362,9 +1362,9 @@ class MpdFrontend(object):
|
|||||||
Album, Artist, Track
|
Album, Artist, Track
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return self.backend.stored_playlists.get_by_name(name).mpd_format(
|
return self.backend.stored_playlists.get(name=name).mpd_format(
|
||||||
search_result=True)
|
search_result=True)
|
||||||
except KeyError as e:
|
except LookupError as e:
|
||||||
raise MpdAckError(e[0])
|
raise MpdAckError(e[0])
|
||||||
|
|
||||||
@handle_pattern(r'^listplaylists$')
|
@handle_pattern(r'^listplaylists$')
|
||||||
|
|||||||
@ -824,7 +824,7 @@ class StoredPlaylistsHandlerTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_listplaylist_fails_if_no_playlist_is_found(self):
|
def test_listplaylist_fails_if_no_playlist_is_found(self):
|
||||||
result = self.h.handle_request(u'listplaylist "name"')
|
result = self.h.handle_request(u'listplaylist "name"')
|
||||||
self.assert_(u'ACK Name "name" not found' in result)
|
self.assert_(u'ACK "name=name" match no playlists' in result)
|
||||||
|
|
||||||
def test_listplaylistinfo(self):
|
def test_listplaylistinfo(self):
|
||||||
self.b.stored_playlists.playlists = [
|
self.b.stored_playlists.playlists = [
|
||||||
@ -837,7 +837,7 @@ class StoredPlaylistsHandlerTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_listplaylistinfo_fails_if_no_playlist_is_found(self):
|
def test_listplaylistinfo_fails_if_no_playlist_is_found(self):
|
||||||
result = self.h.handle_request(u'listplaylistinfo "name"')
|
result = self.h.handle_request(u'listplaylistinfo "name"')
|
||||||
self.assert_(u'ACK Name "name" not found' in result)
|
self.assert_(u'ACK "name=name" match no playlists' in result)
|
||||||
|
|
||||||
def test_listplaylists(self):
|
def test_listplaylists(self):
|
||||||
last_modified = dt.datetime(2001, 3, 17, 13, 41, 17)
|
last_modified = dt.datetime(2001, 3, 17, 13, 41, 17)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user