diff options
author | Max Kellermann <max@musicpd.org> | 2021-02-18 21:59:47 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-02-18 22:16:11 +0100 |
commit | c729f16dcdd37dd7a528ef8cb531f2e72aea12d6 (patch) | |
tree | e4dadd3ebe27949c16791795a4668b9109dc248b /src/db | |
parent | 81d0c04ed41125b73f8bb04d3acc80788595712f (diff) |
song/DetachedSong: copy the AudioFormat from LightSong
Enables the "Format" row in "playlistinfo" responses.
https://github.com/MusicPlayerDaemon/MPD/issues/1094
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/plugins/simple/DirectorySave.cxx | 5 | ||||
-rw-r--r-- | src/db/plugins/simple/Song.cxx | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/db/plugins/simple/DirectorySave.cxx b/src/db/plugins/simple/DirectorySave.cxx index 71e9caaeb..adcd15f84 100644 --- a/src/db/plugins/simple/DirectorySave.cxx +++ b/src/db/plugins/simple/DirectorySave.cxx @@ -168,15 +168,12 @@ directory_load(TextFile &file, Directory &directory) throw FormatRuntimeError("Duplicate song '%s'", name); std::string target; - auto audio_format = AudioFormat::Undefined(); auto detached_song = song_load(file, name, - &target, - &audio_format); + &target); auto song = std::make_unique<Song>(std::move(detached_song), directory); song->target = std::move(target); - song->audio_format = audio_format; directory.AddSong(std::move(song)); } else if ((p = StringAfterPrefix(line, PLAYLIST_META_BEGIN))) { diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx index 8db47d03f..162a2732f 100644 --- a/src/db/plugins/simple/Song.cxx +++ b/src/db/plugins/simple/Song.cxx @@ -34,6 +34,7 @@ Song::Song(DetachedSong &&other, Directory &_parent) noexcept mtime(other.GetLastModified()), start_time(other.GetStartTime()), end_time(other.GetEndTime()), + audio_format(other.GetAudioFormat()), filename(other.GetURI()) { } |