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

+6 -4
View File
@@ -374,17 +374,19 @@ class SubpyConn:
https://opensubsonic.netlify.app/docs/endpoints/scrobble/
id: str - unique identifier of the media to scrobble
OPTIONAL time: int - posix time of when the song was listened to
OPTIONAL scrobble_time: int - posix time of when the song was listened to. Default: Current Time (UNIX_E)
OPTIONAL submission: bool - Whether this is a "submission" or a "now playing" notification. Default: True
"""
def scrobble(self, id: str, time: int | None = None, submission: bool | None = True) -> None:
def scrobble(self, id: str, scrobble_time: int | None = None, submission: bool | None = True) -> None:
url = self.base_url + '/rest/scrobble?'
payload = self._getBasePayload()
payload['id'] = id
if time:
payload['time'] = time
if scrobble_time is None:
payload['time'] = round(time.time() * 1000)
elif scrobble_time:
payload['time'] = scrobble_time
payload['submission'] = submission