From 2efd8ef52ddf880c26d48bcb55eb1fd4c830481a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 28 Aug 2014 12:35:26 +0200 Subject: db/LightSong: use std::chrono::duration for start_ms and end_ms --- src/SongPrint.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/SongPrint.cxx') diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index d14eea417..e5ebfaab2 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -75,16 +75,19 @@ song_print_info(Client &client, const LightSong &song, bool base) { song_print_uri(client, song, base); - if (song.end_ms > 0) + const unsigned start_ms = song.start_time.ToMS(); + const unsigned end_ms = song.end_time.ToMS(); + + if (end_ms > 0) client_printf(client, "Range: %u.%03u-%u.%03u\n", - song.start_ms / 1000, - song.start_ms % 1000, - song.end_ms / 1000, - song.end_ms % 1000); - else if (song.start_ms > 0) + start_ms / 1000, + start_ms % 1000, + end_ms / 1000, + end_ms % 1000); + else if (start_ms > 0) client_printf(client, "Range: %u.%03u-\n", - song.start_ms / 1000, - song.start_ms % 1000); + start_ms / 1000, + start_ms % 1000); if (song.mtime > 0) time_print(client, "Last-Modified", song.mtime); -- cgit v1.2.3