From 9654a33218ce45aa03b914f8806e92dd2c554a84 Mon Sep 17 00:00:00 2001 From: Fredrik Noring Date: Sun, 4 Aug 2019 11:29:24 +0200 Subject: [PATCH] decoder/sidplay: Fix empty album names by using the SID name field SID files are generally collections of tunes, so a SID name field makes sense as an MPD album. The SID tune information list (STIL) has name and title fields for individual tunes, when such are known, but MPD is currently not using the STIL. --- NEWS | 1 + src/decoder/plugins/SidplayDecoderPlugin.cxx | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 96ddb5f50..1a4eca114 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ ver 0.22 (not yet released) - iso9660: support seeking * decoder - sidplay: add option "default_genre" + - sidplay: map SID name field to "Album" tag * filter - ffmpeg: new plugin based on FFmpeg's libavfilter library - hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback diff --git a/src/decoder/plugins/SidplayDecoderPlugin.cxx b/src/decoder/plugins/SidplayDecoderPlugin.cxx index c9c71f6eb..8dc4d47b4 100644 --- a/src/decoder/plugins/SidplayDecoderPlugin.cxx +++ b/src/decoder/plugins/SidplayDecoderPlugin.cxx @@ -510,16 +510,18 @@ static void ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks, TagHandler &handler) noexcept { - /* title */ - const auto title = GetInfoString(info, 0); + /* album */ + const auto album = GetInfoString(info, 0); + + handler.OnTag(TAG_ALBUM, album.c_str()); if (n_tracks > 1) { const auto tag_title = StringFormat<1024>("%s (%u/%u)", - title.c_str(), track, n_tracks); + album.c_str(), track, n_tracks); handler.OnTag(TAG_TITLE, tag_title.c_str()); } else - handler.OnTag(TAG_TITLE, title.c_str()); + handler.OnTag(TAG_TITLE, album.c_str()); /* artist */ const auto artist = GetInfoString(info, 1);