diff options
author | Max Kellermann <max@duempel.org> | 2014-08-28 12:35:26 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-28 13:03:18 +0200 |
commit | 2efd8ef52ddf880c26d48bcb55eb1fd4c830481a (patch) | |
tree | 41110f0e91fad7ef12ac930ab19e5b96fa5962eb /src/SongPrint.cxx | |
parent | 6ad933982f68f5fcbd1b3179bf5fed26f63aa792 (diff) | |
download | mpd-2efd8ef52ddf880c26d48bcb55eb1fd4c830481a.tar.gz mpd-2efd8ef52ddf880c26d48bcb55eb1fd4c830481a.tar.xz mpd-2efd8ef52ddf880c26d48bcb55eb1fd4c830481a.zip |
db/LightSong: use std::chrono::duration for start_ms and end_ms
Diffstat (limited to 'src/SongPrint.cxx')
-rw-r--r-- | src/SongPrint.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
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); |