mpd: Minor refactoring

This commit is contained in:
Stein Magnus Jodal 2012-12-23 20:56:49 +01:00
parent bbd8630d88
commit 30a78ba84b

View File

@ -329,8 +329,7 @@ def seek(context, songpos, seconds):
- issues ``seek 1 120`` without quotes around the arguments. - issues ``seek 1 120`` without quotes around the arguments.
""" """
songpos = int(songpos) if context.core.playback.tracklist_position.get() != int(songpos):
if context.core.playback.tracklist_position.get() != songpos:
playpos(context, songpos) playpos(context, songpos)
context.core.playback.seek(int(seconds) * 1000).get() 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``. Seeks to the position ``TIME`` (in seconds) of song ``SONGID``.
""" """
tlid = int(tlid)
tl_track = context.core.playback.current_tl_track.get() 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) playid(context, tlid)
context.core.playback.seek(int(seconds) * 1000).get() context.core.playback.seek(int(seconds) * 1000).get()