The code has been updated to do a check if the song from YouTube Music history has been played today, if no, a new local record is created and song scrobbled to Last.fm. If yes, the local record is updated if the position in the array the song was found in is less than before, then scrobbled to Last.fm.
This makes it possible to track songs being played multiple times a day.
The code should work both if you want to scrobble only e.g. once per day, or (recommended) with a 3-5 minute interval.
Also added some more output to the console to show which songs are being scrobbled to Last.fm.
The code has been updated to do a check if the song from YouTube Music history has been played today, if no, a new local record is created and song scrobbled to Last.fm. If yes, the local record is updated if the position in the array the song was found in is less than before, then scrobbled to Last.fm.
This makes it possible to track songs being played multiple times a day.
The code should work both if you want to scrobble only e.g. once per day, or (recommended) with a 3-5 minute interval.
Also added some more output to the console to show which songs are being scrobbled to Last.fm.