From b365d2494bceb84c328c2f6888bb139ba3b43376 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sun, 14 Dec 2014 14:16:37 +0100 Subject: [PATCH] mpd: Remove "Comment" tag type from translator output. Newer versions of the protocol have removed this tag, so we should as well. This also works around the issue of #881 which was breaking things with newlines in comment fields. The readcomments command seems to replace this, but it seems to only care about specific extra tagtypes, not the general comment tag we normally collect when scanning things. (cherry picked from commit 08a8d5c43be271a41af74ce0c7df9d871cf2b532) --- mopidy/mpd/translator.py | 3 --- tests/mpd/test_translator.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/mopidy/mpd/translator.py b/mopidy/mpd/translator.py index f3264a46..8a43f929 100644 --- a/mopidy/mpd/translator.py +++ b/mopidy/mpd/translator.py @@ -81,9 +81,6 @@ def track_to_mpd_format(track, position=None): if track.disc_no: result.append(('Disc', track.disc_no)) - if track.comment: - result.append(('Comment', track.comment)) - if track.musicbrainz_id is not None: result.append(('MUSICBRAINZ_TRACKID', track.musicbrainz_id)) return result diff --git a/tests/mpd/test_translator.py b/tests/mpd/test_translator.py index 2bd6cff6..05a0d187 100644 --- a/tests/mpd/test_translator.py +++ b/tests/mpd/test_translator.py @@ -73,10 +73,10 @@ class TrackMpdFormatTest(unittest.TestCase): self.assertIn(('Track', '7/13'), result) self.assertIn(('Date', datetime.date(1977, 1, 1)), result) self.assertIn(('Disc', '1'), result) - self.assertIn(('Comment', 'a comment'), result) self.assertIn(('Pos', 9), result) self.assertIn(('Id', 122), result) - self.assertEqual(len(result), 15) + self.assertNotIn(('Comment', 'a comment'), result) + self.assertEqual(len(result), 14) def test_track_to_mpd_format_musicbrainz_trackid(self): track = self.track.copy(musicbrainz_id='foo')