maybe add scrobbling for cached songs

This commit is contained in:
JISAUAY committed 2025-09-10 10:52:47 -05:00
1 parent b6b07e830b
commit 0856fbfbbf
2 files changed
+9 -4

No files matched your search

+3
View File
@@ -533,6 +533,9 @@ class TextualSubpyPlayer(App):
if CACHE and os.path.exists(audio_cache_path):
with open(audio_cache_path, 'rb') as file:
audio_data = io.BytesIO(file.read())
# If file was found in cache record scrobble
asyncio.create_task(asyncio.to_thread(conn.scrobble, song.id, submission=False))
else:
# Run the blocking stream call in a separate thread
r = await asyncio.to_thread(conn.stream, song.id)