diff --git a/beetsplug/bpd/__init__.py b/beetsplug/bpd/__init__.py index a29690b03..0d16e22ca 100644 --- a/beetsplug/bpd/__init__.py +++ b/beetsplug/bpd/__init__.py @@ -307,9 +307,11 @@ class BaseServer(object): u'random: ' + six.text_type(int(self.random)), u'playlist: ' + six.text_type(self.playlist_version), u'playlistlength: ' + six.text_type(len(self.playlist)), - u'xfade: ' + six.text_type(self.crossfade), ) + if self.crossfade > 0: + yield u'xfade: ' + six.text_type(self.crossfade) + if self.current_index == -1: state = u'stop' elif self.paused: @@ -353,6 +355,8 @@ class BaseServer(object): crossfade = cast_arg(int, crossfade) if crossfade < 0: raise BPDError(ERROR_ARG, u'crossfade time must be nonnegative') + self._log.warning(u'crossfade is not implemented in bpd') + self.crossfade = crossfade def cmd_clear(self, conn): """Clear the playlist.""" diff --git a/test/test_player.py b/test/test_player.py index 1e917f078..d7f65ff3f 100644 --- a/test/test_player.py +++ b/test/test_player.py @@ -356,11 +356,24 @@ class BPDQueryTest(BPDTestHelper): class BPDPlaybackTest(BPDTestHelper): test_implements_playback = implements({ - 'consume', 'crossfade', 'mixrampd', 'mixrampdelay', 'random', + 'consume', 'mixrampd', 'mixrampdelay', 'random', 'repeat', 'setvol', 'single', 'replay_gain_mode', 'replay_gain_status', 'volume', }, expectedFailure=True) + def test_cmd_crossfade(self): + with self.run_bpd() as client: + responses = client.send_commands( + ('status',), + ('crossfade', '123'), + ('status',), + ('crossfade', '-2')) + response = client.send_command('crossfade', '0.5') + self._assert_failed(responses, bpd.ERROR_ARG, pos=3) + self._assert_failed(response, bpd.ERROR_ARG) + self.assertNotIn('xfade', responses[0].data) + self.assertAlmostEqual(123, int(responses[2].data['xfade'])) + class BPDControlTest(BPDTestHelper): test_implements_control = implements({