mpd: Minor refactoring
This commit is contained in:
parent
bbd8630d88
commit
30a78ba84b
@ -329,8 +329,7 @@ def seek(context, songpos, seconds):
|
||||
|
||||
- issues ``seek 1 120`` without quotes around the arguments.
|
||||
"""
|
||||
songpos = int(songpos)
|
||||
if context.core.playback.tracklist_position.get() != songpos:
|
||||
if context.core.playback.tracklist_position.get() != int(songpos):
|
||||
playpos(context, songpos)
|
||||
context.core.playback.seek(int(seconds) * 1000).get()
|
||||
|
||||
@ -344,9 +343,8 @@ def seekid(context, tlid, seconds):
|
||||
|
||||
Seeks to the position ``TIME`` (in seconds) of song ``SONGID``.
|
||||
"""
|
||||
tlid = int(tlid)
|
||||
tl_track = context.core.playback.current_tl_track.get()
|
||||
if not tl_track or tl_track.tlid != tlid:
|
||||
if not tl_track or tl_track.tlid != int(tlid):
|
||||
playid(context, tlid)
|
||||
context.core.playback.seek(int(seconds) * 1000).get()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user