use api duration value as placeholder

This commit is contained in:
Erica Z 2024-10-16 13:12:58 +02:00
parent 6bdf5d7e5c
commit f4744f03c3
2 changed files with 6 additions and 1 deletions

View file

@ -243,7 +243,7 @@ class Playbin : GLib.Object {
this.current_song = song; this.current_song = song;
this.position = 0; this.position = 0;
this.duration = 1; this.duration = song.duration * 1000000000 - 1;
this.now_playing (false); this.now_playing (false);
} }

View file

@ -61,6 +61,7 @@ public class Subsonic.Song : Object {
public int64 track { get; private set; } public int64 track { get; private set; }
public int64 year { get; private set; } public int64 year { get; private set; }
public DateTime? starred { get; private set; } public DateTime? starred { get; private set; }
public int64 duration { get; private set; }
public Song (Json.Reader reader) { public Song (Json.Reader reader) {
reader.read_member ("id"); reader.read_member ("id");
@ -86,6 +87,10 @@ public class Subsonic.Song : Object {
reader.read_member ("year"); reader.read_member ("year");
this.year = reader.get_int_value (); this.year = reader.get_int_value ();
reader.end_member (); reader.end_member ();
reader.read_member ("duration");
this.duration = reader.get_int_value ();
reader.end_member ();
} }
} }