song/DetachedSong: copy the AudioFormat from LightSong

Enables the "Format" row in "playlistinfo" responses.

https://github.com/MusicPlayerDaemon/MPD/issues/1094
This commit is contained in:
Max Kellermann
2021-02-18 21:59:47 +01:00
parent 81d0c04ed4
commit c729f16dcd
10 changed files with 40 additions and 18 deletions

View File

@@ -111,6 +111,9 @@ song_print_info(Response &r, const DetachedSong &song, bool base) noexcept
if (!IsNegative(song.GetLastModified()))
time_print(r, "Last-Modified", song.GetLastModified());
if (const auto &f = song.GetAudioFormat(); f.IsDefined())
r.Format("Format: %s\n", ToString(f).c_str());
tag_print_values(r, song.GetTag());
const auto duration = song.GetDuration();