Commit fee282f4 authored by Max Kellermann's avatar Max Kellermann

SongPrint: use LightSong::GetDuration()

This properly prints the "Time"/"duration" values for songs in virtual CUE folders. This is loosely related to https://github.com/MusicPlayerDaemon/MPD/issues/1048
parent 07d2bc68
ver 0.22.4 (not yet released) ver 0.22.4 (not yet released)
* protocol * protocol
- fix "readpicture" on 32 bit machines - fix "readpicture" on 32 bit machines
- show duration of songs in virtual playlist (CUE) folders
* storage * storage
- curl: fix several WebDAV protocol bugs - curl: fix several WebDAV protocol bugs
* decoder * decoder
......
...@@ -91,7 +91,14 @@ song_print_info(Response &r, const LightSong &song, bool base) noexcept ...@@ -91,7 +91,14 @@ song_print_info(Response &r, const LightSong &song, bool base) noexcept
if (song.audio_format.IsDefined()) if (song.audio_format.IsDefined())
r.Format("Format: %s\n", ToString(song.audio_format).c_str()); r.Format("Format: %s\n", ToString(song.audio_format).c_str());
tag_print(r, song.tag); tag_print_values(r, song.tag);
const auto duration = song.GetDuration();
if (!duration.IsNegative())
r.Format("Time: %i\n"
"duration: %1.3f\n",
duration.RoundS(),
duration.ToDoubleS());
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment