mirror of
https://github.com/zoriya/astal.git
synced 2026-06-02 18:20:48 +00:00
fix(mpris): length getter
the spec says length is supposed to be an int64 but spotify is returning a uint64
This commit is contained in:
@@ -245,10 +245,16 @@ public class Player : Object {
|
||||
// metadata
|
||||
metadata = proxy.metadata;
|
||||
if (metadata != null) {
|
||||
if (metadata.get("mpris:length") != null)
|
||||
length = (double)metadata.get("mpris:length").get_uint64() / 1000000;
|
||||
else
|
||||
if (metadata.get("mpris:length") != null) {
|
||||
var v = metadata.get("mpris:length");
|
||||
if (v.get_type_string() == "x") {
|
||||
length = (double)v.get_int64() / 1000000;
|
||||
} else if (v.get_type_string() == "t") {
|
||||
length = (double)v.get_uint64() / 1000000;
|
||||
}
|
||||
} else {
|
||||
length = -1;
|
||||
}
|
||||
|
||||
trackid = get_str("mpris:trackid");
|
||||
art_url = get_str("mpris:artUrl");
|
||||
|
||||
Reference in New Issue
Block a user