mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
bpd: support nextsong in status
This commit is contained in:
parent
fdd809fd36
commit
dc7e3b9b6a
2 changed files with 7 additions and 1 deletions
|
|
@ -412,6 +412,11 @@ class BaseServer(object):
|
|||
current_id = self._item_id(self.playlist[self.current_index])
|
||||
yield u'song: ' + six.text_type(self.current_index)
|
||||
yield u'songid: ' + six.text_type(current_id)
|
||||
if len(self.playlist) > self.current_index + 1:
|
||||
# If there's a next song, report its index too.
|
||||
next_id = self._item_id(self.playlist[self.current_index + 1])
|
||||
yield u'nextsong: ' + six.text_type(self.current_index + 1)
|
||||
yield u'nextsongid: ' + six.text_type(next_id)
|
||||
|
||||
if self.error:
|
||||
yield u'error: ' + self.error
|
||||
|
|
|
|||
|
|
@ -433,7 +433,8 @@ class BPDQueryTest(BPDTestHelper):
|
|||
}
|
||||
self.assertEqual(fields_not_playing, set(responses[0].data.keys()))
|
||||
fields_playing = fields_not_playing | {
|
||||
'song', 'songid', 'time', 'elapsed', 'bitrate', 'duration', 'audio'
|
||||
'song', 'songid', 'time', 'elapsed', 'bitrate', 'duration',
|
||||
'audio', 'nextsong', 'nextsongid'
|
||||
}
|
||||
self.assertEqual(fields_playing, set(responses[2].data.keys()))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue