Skip to content

Commit

Permalink
Avoid to require a g_previous_song in order to trigger a scrobble
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Dec 22, 2024
1 parent 8dd1023 commit cdebc4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Start the container with the following:

DATE|DESCRIPTION
:---|:---
2024-12-22|Avoid to require a g_previous_song in order to trigger a scrobble
2024-12-22|Remove handling of impossible situation
2024-12-22|Catch empty metadata
2024-12-22|Don't consider track_uri as a difference between tracks
Expand Down
2 changes: 1 addition & 1 deletion upnp_scrobbler/scrobbler.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def on_event(
print("Updating Now Playing with song information because we have new metadata ...")
on_playing(new_metadata)
# did the song change?
if g_previous_song and not same_song(g_previous_song, g_current_song):
if (g_previous_song is None) or (not same_song(g_previous_song, g_current_song)):
print("Scrobbling because we have a new song in incoming metadata (new_metadata)")
maybe_scrobble(current_song=g_current_song)
print("Resetting g_current_song after scrobbling because of new incoming metadata ...")
Expand Down

0 comments on commit cdebc4b

Please sign in to comment.