curds: Forbid selecting the Previous playlist
I guess this could be lifted later if anybody asks for it, but I don't think this really makes sense as a playlist source. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
3871cc5d9c
commit
390f7c4a28
|
@ -155,6 +155,8 @@ class PlaylistManager(PlaylistManagerBase):
|
|||
|
||||
if plist == self.lookup("Collection"):
|
||||
self.current = [ ]
|
||||
elif plist == self.lookup("Previous"):
|
||||
return
|
||||
elif plist in self.current:
|
||||
self.current.remove(plist)
|
||||
self.current.insert(0, plist)
|
||||
|
|
|
@ -251,6 +251,11 @@ class TestPlaylistManager(unittest.TestCase):
|
|||
self.assertEqual(self.playman.current, [ plist, glist, clist ])
|
||||
self.assertEqual(self.cb_change[-2:], [ glist, plist ])
|
||||
|
||||
self.cb_change = [ ]
|
||||
self.playman.select(self.playman.lookup("Previous"))
|
||||
self.assertEqual(self.playman.current, [ plist, glist, clist ])
|
||||
self.assertEqual(self.cb_change, [ ])
|
||||
|
||||
plist.current = 1247
|
||||
peek = self.playman.peek(4)
|
||||
self.assertEqual(len(peek), 4)
|
||||
|
|
Loading…
Reference in New Issue