fix compilation on rustc <1.33

also, precision in the seconds should be good enough

fixes #33
This commit is contained in:
Henrik Friedrichsen
2019-03-14 21:00:46 +01:00
parent a5d00730ea
commit 3d385aff9b

View File

@@ -198,10 +198,11 @@ fn run_dbus_server(spotify: Arc<Spotify>, queue: Arc<Mutex<Queue>>, rx: mpsc::Re
let property_position = { let property_position = {
let spotify = spotify.clone(); let spotify = spotify.clone();
let progress = spotify.get_current_progress();
f.property::<i64, _>("Position", ()) f.property::<i64, _>("Position", ())
.access(Access::Read) .access(Access::Read)
.on_get(move |iter, _| { .on_get(move |iter, _| {
iter.append(spotify.get_current_progress().as_micros() as i64); iter.append(progress.as_secs() as i64 * 1000);
Ok(()) Ok(())
}) })
}; };