This commit is contained in:
cwilvx
2024-12-31 01:01:48 +03:00
parent c64f40e54b
commit df4c911371
2 changed files with 11 additions and 4 deletions
+6 -3
View File
@@ -36,17 +36,20 @@ class RecentlyPlayed(HomepageRoutine):
limit=self.ITEM_LIMIT, userid=self.userids[0], _entries=[last_entry] limit=self.ITEM_LIMIT, userid=self.userids[0], _entries=[last_entry]
) )
item = items[0]
try: try:
item = items[0]
store_entry = HomepageStore.entries[self.store_key].items[ store_entry = HomepageStore.entries[self.store_key].items[
self.userids[0] self.userids[0]
][0] ][0]
except IndexError: except IndexError:
store_entry = None store_entry = None
item = None
if ( if (
store_entry and item["type"] + item["hash"] store_entry
== store_entry["type"] + store_entry["hash"] and item
and store_entry["type"] + store_entry["hash"]
== item["type"] + item["hash"]
): ):
# If the item is the same as the one in the store # If the item is the same as the one in the store
# only update the timestamp # only update the timestamp
+5 -1
View File
@@ -70,7 +70,11 @@ class LastFmPlugin(Plugin):
"albumArtist": track.albumartists[0]["name"], "albumArtist": track.albumartists[0]["name"],
} }
print("scrobble data:", data)
try: try:
self.post(data) res = self.post(data)
print("scrobble response:", res.text)
print("scrobble response json:", res.json())
except Exception as e: except Exception as e:
print("scrobble error", e) print("scrobble error", e)