From 6323a0762940561a467e46cf2716c8aa12fb6a15 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 16 Nov 2013 01:55:23 +0100 Subject: [PATCH] mpd: Don't save comments to tag cache As they can contain newlines. Fixes #579. --- mopidy/frontends/mpd/translator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mopidy/frontends/mpd/translator.py b/mopidy/frontends/mpd/translator.py index e103e170..e4fb0d62 100644 --- a/mopidy/frontends/mpd/translator.py +++ b/mopidy/frontends/mpd/translator.py @@ -322,6 +322,12 @@ def _add_to_tag_cache(result, dirs, files, media_dir): for track in files: track_result = dict(track_to_mpd_format(track)) + # XXX Don't save comments to the tag cache as they may span multiple + # lines. We'll start saving track comments when we move from tag_cache + # to a JSON file. See #579 for details. + if 'Comment' in track_result: + del track_result['Comment'] + path = uri_to_path(track_result['file']) try: text_path = path.decode('utf-8')