File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ pub struct Entry {
40
40
#[ serde( skip_deserializing) ]
41
41
platform : String ,
42
42
/// Miliseconds the song has been played for
43
- ms_played : u32 ,
43
+ ms_played : i64 ,
44
44
/// Skipped
45
45
#[ serde( skip_deserializing) ]
46
46
conn_country : ( ) ,
@@ -151,7 +151,7 @@ fn entry_to_songentry(entry: Entry) -> Result<SongEntry, PodEntry> {
151
151
}
152
152
Ok ( SongEntry {
153
153
timestamp : parse_date ( & entry. ts ) ,
154
- ms_played : entry. ms_played ,
154
+ time_played : chrono :: Duration :: milliseconds ( entry. ms_played ) ,
155
155
track : parse_option ( entry. master_metadata_track_name ) ,
156
156
album : parse_option ( entry. master_metadata_album_album_name ) ,
157
157
artist : parse_option ( entry. master_metadata_album_artist_name ) ,
Original file line number Diff line number Diff line change 3
3
use std:: error:: Error ;
4
4
use std:: fmt:: Display ;
5
5
6
- use chrono:: DateTime ;
6
+ use chrono:: { DateTime , Duration } ;
7
7
use chrono_tz:: Tz ;
8
8
9
9
use crate :: display;
@@ -163,7 +163,7 @@ pub struct SongEntry {
163
163
/// the time at which the song has been played
164
164
pub timestamp : DateTime < chrono_tz:: Tz > ,
165
165
/// for how long the song has been played
166
- pub ms_played : u32 ,
166
+ pub time_played : Duration ,
167
167
/// name of the song
168
168
pub track : String ,
169
169
/// name of the album
You can’t perform that action at this time.
0 commit comments