Should get some tests for this stuff
This commit is contained in:
@ -64,7 +64,7 @@ class WebhooksFrontend(pykka.ThreadingActor, CoreListener):
|
|||||||
track = tl_track.track
|
track = tl_track.track
|
||||||
artists = ", ".join(sorted([a.name for a in track.artists]))
|
artists = ", ".join(sorted([a.name for a in track.artists]))
|
||||||
self.last_start_time = int(time.time())
|
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)
|
post_data = self._build_post_data(tl_track.track)
|
||||||
|
|
||||||
# Build post data to send to urls
|
# 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
|
duration = track.length and track.length // 1000 or 0
|
||||||
time_position = time_position // 1000
|
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)
|
post_data = self._build_post_data(tl_track.track)
|
||||||
|
|
||||||
if time_position < duration // 2 and time_position < 240:
|
if time_position < duration // 2 and time_position < 240:
|
||||||
@ -94,8 +93,5 @@ class WebhooksFrontend(pykka.ThreadingActor, CoreListener):
|
|||||||
logger.info(
|
logger.info(
|
||||||
f"Scrobbling finished via webhooks: {artists} - {track.name}"
|
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")
|
self._post_update_to_webhooks(post_data, "stopped")
|
||||||
|
|||||||
Reference in New Issue
Block a user