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:
Anna Schumaker 2019-12-15 09:18:39 -05:00
parent 1088bb16ce
commit eb507d96d1
3 changed files with 2 additions and 5 deletions

View File

@ -31,7 +31,7 @@ def next():
def previous():
global Track
with Lock:
Track = Root.previous()
Track = Root.lookup("Previous").next()
return Track
def save():

View File

@ -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:

View File

@ -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()