curds: Move playlist previous() function out of Root
And into the package init file Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
1088bb16ce
commit
eb507d96d1
|
@ -31,7 +31,7 @@ def next():
|
|||
def previous():
|
||||
global Track
|
||||
with Lock:
|
||||
Track = Root.previous()
|
||||
Track = Root.lookup("Previous").next()
|
||||
return Track
|
||||
|
||||
def save():
|
||||
|
|
|
@ -74,9 +74,6 @@ class PlaylistRoot(node.PlaylistNode):
|
|||
random.setstate(state)
|
||||
return res
|
||||
|
||||
def previous(self):
|
||||
return self.lookup("Previous").next()
|
||||
|
||||
def reset(self):
|
||||
with self.node_lock:
|
||||
for plist in self.children:
|
||||
|
|
|
@ -130,7 +130,7 @@ class TestPlaylistRoot(unittest.TestCase):
|
|||
self.assertEqual(prev[0], track2)
|
||||
self.assertEqual(prev[1], track1)
|
||||
|
||||
self.assertEqual(self.playman.previous(), track1)
|
||||
self.assertEqual(self.playman.lookup("Previous").next(), track1)
|
||||
self.assertEqual(self.cb_track, track2)
|
||||
|
||||
self.playman.reset()
|
||||
|
|
Loading…
Reference in New Issue