Use current_playlist.length instead of len(current_playlist.tracks)
This commit is contained in:
parent
8849c99675
commit
6e9dd194df
@ -55,8 +55,7 @@ def addid(context, uri, songpos=None):
|
||||
track = context.backend.library.lookup(uri).get()
|
||||
if track is None:
|
||||
raise MpdNoExistError(u'No such song', command=u'addid')
|
||||
if songpos and songpos > len(
|
||||
context.backend.current_playlist.tracks.get()):
|
||||
if songpos and songpos > context.backend.current_playlist.length.get():
|
||||
raise MpdArgError(u'Bad song index', command=u'addid')
|
||||
cp_track = context.backend.current_playlist.add(track,
|
||||
at_position=songpos).get()
|
||||
@ -132,7 +131,7 @@ def move_range(context, start, to, end=None):
|
||||
``TO`` in the playlist.
|
||||
"""
|
||||
if end is None:
|
||||
end = len(context.backend.current_playlist.tracks.get())
|
||||
end = context.backend.current_playlist.length.get()
|
||||
start = int(start)
|
||||
end = int(end)
|
||||
to = int(to)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user