Should get some tests for this stuff

This commit is contained in:
2023-01-08 03:03:01 -05:00
parent f86ae61acf
commit 875dbe8f8a

View File

@ -64,7 +64,7 @@ class WebhooksFrontend(pykka.ThreadingActor, CoreListener):
track = tl_track.track
artists = ", ".join(sorted([a.name for a in track.artists]))
self.last_start_time = int(time.time())
logger.debug(f"Now playing track: {track.artists[0]} - {track.name}")
logger.debug(f"Now playing track: {artists} - {track.name}")
post_data = self._build_post_data(tl_track.track)
# Build post data to send to urls
@ -80,7 +80,6 @@ class WebhooksFrontend(pykka.ThreadingActor, CoreListener):
duration = track.length and track.length // 1000 or 0
time_position = time_position // 1000
logger.debug(f"Now playing track: {track.artists[0]} - {track.name}")
post_data = self._build_post_data(tl_track.track)
if time_position < duration // 2 and time_position < 240:
@ -94,8 +93,5 @@ class WebhooksFrontend(pykka.ThreadingActor, CoreListener):
logger.info(
f"Scrobbling finished via webhooks: {artists} - {track.name}"
)
logger.debug(
f"Sending scroble to webhooks for track: {track.artists} - {track.name}"
)
self._post_update_to_webhooks(post_data, "stopped")