From f4744f03c3125c7b5a74aa4a14f505af3873aee0 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Wed, 16 Oct 2024 13:12:58 +0200 Subject: [PATCH] use api duration value as placeholder --- src/playbin.vala | 2 +- src/subsonic.vala | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/playbin.vala b/src/playbin.vala index 9cade75..65dc7ed 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -243,7 +243,7 @@ class Playbin : GLib.Object { this.current_song = song; this.position = 0; - this.duration = 1; + this.duration = song.duration * 1000000000 - 1; this.now_playing (false); } diff --git a/src/subsonic.vala b/src/subsonic.vala index 9d7904e..0bc7b4c 100644 --- a/src/subsonic.vala +++ b/src/subsonic.vala @@ -61,6 +61,7 @@ public class Subsonic.Song : Object { public int64 track { get; private set; } public int64 year { get; private set; } public DateTime? starred { get; private set; } + public int64 duration { get; private set; } public Song (Json.Reader reader) { reader.read_member ("id"); @@ -86,6 +87,10 @@ public class Subsonic.Song : Object { reader.read_member ("year"); this.year = reader.get_int_value (); reader.end_member (); + + reader.read_member ("duration"); + this.duration = reader.get_int_value (); + reader.end_member (); } }