fix: only record spotify's trackid, ignore local ones
This commit is contained in:
+1
-2
@@ -71,8 +71,7 @@ class CacheEngine:
|
|||||||
expires_at INTEGER,
|
expires_at INTEGER,
|
||||||
artist TEXT,
|
artist TEXT,
|
||||||
title TEXT,
|
title TEXT,
|
||||||
album TEXT,
|
album TEXT
|
||||||
length INTEGER
|
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
# Migrations
|
# Migrations
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ async def _fetch_metadata_dbus(
|
|||||||
trackid = trackid.removeprefix("spotify:track:")
|
trackid = trackid.removeprefix("spotify:track:")
|
||||||
elif trackid.startswith("/com/spotify/track/"):
|
elif trackid.startswith("/com/spotify/track/"):
|
||||||
trackid = trackid.removeprefix("/com/spotify/track/")
|
trackid = trackid.removeprefix("/com/spotify/track/")
|
||||||
|
else:
|
||||||
|
trackid = None
|
||||||
|
|
||||||
# Extract length (usually microseconds)
|
# Extract length (usually microseconds)
|
||||||
length = metadata.get("mpris:length", None)
|
length = metadata.get("mpris:length", None)
|
||||||
|
|||||||
Reference in New Issue
Block a user