getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: Haakjvork on December 16, 2023, 07:40:27 PM

Title: Synchronize track playcount with last.fm
Post by: Haakjvork on December 16, 2023, 07:40:27 PM
I just made a plugin that queries tracks individually using track.getInfo to get an user's playcount and update the track playcount.

The plugin should appear when right-clicking as Sync from LastFm with several options:

Update playcount of selected files: Query LastFm to update the currently selected files.

Update playcount of recent scrobbles: Try to find which tracks have been scrobbled on LastFm recently and exists in MusicBee, and then update them.


https://getmusicbee.com/addons/plugins/491/sync-with-lastfm-playcount/

https://github.com/Haakjvork/musicbee-sync-lastfm-playcount

It can make several queries per track depending on the options. If the sum of the queries is 0, it won't make changes.

Current version: 1.2.1 - 2024-11-14

(https://raw.githubusercontent.com/Haakjvork/musicbee-sync-lastfm-playcount/main/screenshot.png)


You can update the plugin replacing the files in your plugins folder while MusicBee is closed:

C:\Users\<user>\AppData\Roaming\MusicBee\Plugins

The main file is: MB_SyncLastFmPlaycount.dll
Dependencies: Newtonsoft.Json.dll and IF.Lastfm.Core.dll
Title: Re: Synchronize track playcount with last.fm
Post by: Bee-liever on December 21, 2023, 06:20:21 AM
Thanks very much for this.
Fixed several thousand incorrect playcounts from not being able to reverse sync Musicolet.
Was a little slow to do the entire scan of my library, but now that's done, I only have to scan the current playlist from my phone.
 :)  :)  :)
Title: Re: Synchronize track playcount with last.fm
Post by: morgan109 on February 02, 2024, 09:52:04 AM
Wow, thank you so much for this, my most requested feature finally!

Edit: Is it possible to do this for loved tracks too? I have some loved tracks that don't register as such in musicbee, despite being loved in last.fm. I've tried clearing my files, reinstalling the addon and more...nothing works, some tracks refuse to be loved in musicbee. I wonder if it's the same problem as the play count thing (that music bee query just 1 time for a specific information).
Title: Re: Synchronize track playcount with last.fm
Post by: morgan109 on February 02, 2024, 12:31:30 PM
And I guess this has to be done manually each time? Can't make it search automatically like the last.fm plugin?
Title: Re: Synchronize track playcount with last.fm
Post by: maeva on February 03, 2024, 07:56:45 PM
hello!
this is such a cool plug in and it's great to see that it is working for many people.
sadly, i'm getting an error when i try to install it

(https://imgur.com/qbh41tn.png)

does anyone know what this could be? :(

thank you very much for the help in advance
Title: Re: Synchronize track playcount with last.fm
Post by: phred on February 03, 2024, 08:48:05 PM
does anyone know what this could be? :(
Probably either what you downloaded is corrupt or you're not installing the plugin properly.

Try downloading again and installing again. Double-check the installation instructions.
Title: Re: Synchronize track playcount with last.fm
Post by: maeva on February 04, 2024, 11:40:25 AM
Try downloading again and installing again. Double-check the installation instructions.

i did that yesterday and today again and it did not work unfortunately. same issue
Title: Re: Synchronize track playcount with last.fm
Post by: phred on February 04, 2024, 11:55:24 AM
I'm not able to provide any further suggestions. Perhaps someone else might have an idea. Or wait until the plugin's developer checks in.
Title: Re: Synchronize track playcount with last.fm
Post by: morgan109 on February 05, 2024, 05:03:58 PM
All I did was place all files in plugin folder and voilà.
Title: Re: Synchronize track playcount with last.fm
Post by: Haakjvork on February 07, 2024, 02:29:37 PM
Thanks for the feedback!

I've been busy these days, but I've updated the plugin for having the option to get the "Loved track" mark from last.fm too

Once installed, with MusicBee closed, you can update the plugin by just replacing MB_SyncLastFmPlaycount.dll  in  C:\Users\<user>\AppData\Roaming\MusicBee\Plugins

The current version I've uploaded it's here. You can find the .dll there too:

https://github.com/Haakjvork/musicbee-sync-lastfm-playcount/releases/tag/v1.0.9


I also wanna make the plugin automatic using recent scrobbles. I'll get into it if i've time these weeks. Cheers!
Title: Re: Synchronize track playcount with last.fm
Post by: lemon_yellow on October 16, 2024, 09:54:33 PM
@Haakjvork is there a way to only update the playcount if musicbee's count is smaller and skip update if musicbee's count is bigger?
Title: Re: Synchronize track playcount with last.fm
Post by: Haakjvork on October 17, 2024, 01:33:56 PM
I just updated the plugin and made an option to update the playcount only when LastFm value is bigger! And also changed the contextual menu (right click menu) with a new option to update from recent scrobbles.

The plugin should appear when right-clicking as Sync from LastFm with several options:

Update playcount of selected files: Query LastFm to update the currently selected files.

Update playcount of recent scrobbles: Try to find which tracks have been scrobbled on LastFm recently and exists in MusicBee, and then update them.

https://github.com/Haakjvork/musicbee-sync-lastfm-playcount/releases/tag/v1.2.0
Title: Re: Synchronize track playcount with last.fm
Post by: The Incredible Boom Boom on October 24, 2024, 10:14:22 PM
I never knew this plugin existed.
What is the difference between the internal MusicBee function and it?
Does this plugin perform the synchronization automatically?
Title: Re: Synchronize track playcount with last.fm
Post by: Haakjvork on November 14, 2024, 11:07:12 AM
I've updated the plugin (v.1.2.1) with an option to query recent tracks when MusicBee starts.

https://github.com/Haakjvork/musicbee-sync-lastfm-playcount/releases/tag/v1.2.1

I've also added a comparison with the default MusicBee plugin in the readme:

MusicBee's default plugin queries all your track history and then recounts your scrobbles with the same artist, title and album. The main goal of this plugin is to ignore the album name and just sum playcounts by "artist" and "track title". It also checks other fields ("album artist" and "sort title") while applying string normalization.
Title: Re: Synchronize track playcount with last.fm
Post by: zxvshj on December 10, 2024, 01:46:19 PM
Thanks for this great plugin, I've been looking for something to do this for years. A couple suggestions, if they are possible to be implemented.

1. Syncing the date/time of Last Played from last.fm. Musicbee will do this by default when it syncs data from last.fm but I believe you have to restart the application for it to work. An option to do this whenever you sync with the plugin would be nice.

2. An option to sync new files automatically when they are added to the library. At the moment I am having to manually select the files and then use the context menu to sync them. Its a minor inconvenience but it would be nice to have this process automated whenever something new is added to the library.

Again thank you for this great plugin I was relieved to finally find this.
Title: Re: Synchronize track playcount with last.fm
Post by: Kenika on January 19, 2025, 09:18:51 AM
Awesome! Just what I was looking for: I just migrated from iTunes to MusicBee and last.fm is killing all my play counts. So being able to tell that last.fm shall only update the play count when smaller is perfect. One question: can this plugin run alongside the built-in last.fm plugin or are there any issues coming along with both running at the same time? I assume that – at least – the play count update  option from the built-in plugin has to be disabled, right?
Thanks!
Title: Re: Synchronize track playcount with last.fm
Post by: StoneImage on March 16, 2025, 02:38:00 AM
Thanks for making a great Plug-in! This Plug-in has been very helpful in enriching my listening experience.

Unfortunately, even though it syncs the play counts for most tracks, the play counts for some tracks are not synced correctly. For the cases where the synchronization failed, the log file recorded like following. In this case, the actual play count of this track appeared in last.fm  is "1"

Quote
2025/03/15 18:56:35 96 of 96: Zoltán Kocsis - Bartók: Mikrokosmos, Sz. 107 - Book 3: No. 96 Jolts
2025/03/15 18:56:35   TrackInfo Zoltán Kocsis - Bartók: Mikrokosmos, Sz. 107 - Book 3: No. 96 Jolts
2025/03/15 18:56:36   TrackInfo Zoltán Kocsis - Bartók: Mikrokosmos, Sz. 107 - Book 3: No. 96 Jolts | ERROR: MissingParameters
2025/03/15 18:56:36   0 -> 0  IGNORE

Is there any possible cause for this? Could someone give a hint to resolve the problem? FYI, the version of Plug-in I'm using is v1.2.2.