fix: only record spotify's trackid, ignore local ones

This commit is contained in:
2026-04-02 10:15:50 +02:00
parent b5038fac80
commit eafc0bf396
2 changed files with 3 additions and 2 deletions
+1 -2
View File
@@ -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
+2
View File
@@ -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)