Merge remote-tracking branch 'sandos/develop' into feature/mpd-performance-fixes
This commit is contained in:
commit
449bb87b90
@ -39,6 +39,13 @@ class CurrentPlaylistController(object):
|
||||
"""
|
||||
return [ct[1] for ct in self._cp_tracks]
|
||||
|
||||
@property
|
||||
def tracks_len(self):
|
||||
"""
|
||||
Length of current playlist
|
||||
"""
|
||||
return len(self._cp_tracks)
|
||||
|
||||
@property
|
||||
def version(self):
|
||||
"""
|
||||
|
||||
@ -254,6 +254,12 @@ def playlistinfo(context, songpos=None,
|
||||
end = songpos + 1
|
||||
if start == -1:
|
||||
end = None
|
||||
else:
|
||||
#Fetch one single track, hot code path (avoid deep-copying the entire playlist)
|
||||
res = context.backend.current_playlist.get(cpid=songpos).get()
|
||||
cpids = [res.cpid]
|
||||
l = [res.track]
|
||||
return tracks_to_mpd_format(l, 0, 1, cpids=cpids)
|
||||
cpids = [ct[0] for ct in
|
||||
context.backend.current_playlist.cp_tracks.get()]
|
||||
return tracks_to_mpd_format(
|
||||
|
||||
@ -166,7 +166,7 @@ def status(context):
|
||||
decimal places for millisecond precision.
|
||||
"""
|
||||
futures = {
|
||||
'current_playlist.tracks': context.backend.current_playlist.tracks,
|
||||
'current_playlist.tracks_len': context.backend.current_playlist.tracks_len,
|
||||
'current_playlist.version': context.backend.current_playlist.version,
|
||||
'mixer.volume': context.mixer.volume,
|
||||
'playback.consume': context.backend.playback.consume,
|
||||
@ -213,7 +213,7 @@ def _status_consume(futures):
|
||||
return 0
|
||||
|
||||
def _status_playlist_length(futures):
|
||||
return len(futures['current_playlist.tracks'].get())
|
||||
return futures['current_playlist.tracks_len'].get()
|
||||
|
||||
def _status_playlist_version(futures):
|
||||
return futures['current_playlist.version'].get()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user