mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-15 03:33:01 +00:00
maybe fix scrobbler/reporter
This commit is contained in:
parent
0fb4edc655
commit
1d6e63e9e9
@ -54,7 +54,7 @@ if track_activity_history or scrobbler_to_fediverse_token != '':
|
||||
# Here, _value is either None if nothing is playing or a float containing
|
||||
# fractional seconds since the beginning of the file.
|
||||
if value:
|
||||
if value >= 30.0 and value <= 30.1 and player.pause is False:
|
||||
if value >= 30.0 and value <= 30.2 and player.pause is False:
|
||||
# detect 30 secs for reporting listen activity
|
||||
try:
|
||||
track = player_fw_storage.storage.get(track_url_to_uuid())
|
||||
@ -85,8 +85,8 @@ if track_activity_history or scrobbler_to_fediverse_token != '':
|
||||
requests.post(f'https://{scrobbler_to_fediverse_instance}/api/v1/statuses',
|
||||
json=status_obj,
|
||||
headers={'Authorization': f'Bearer {scrobbler_to_fediverse_token}'})
|
||||
time.sleep(0.100)
|
||||
if value > 30.1:
|
||||
time.sleep(1)
|
||||
if value > 30.2: # passive mode
|
||||
time.sleep(1)
|
||||
return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user