Post
by jfarr » Wed Mar 06, 2013 2:25 pm
Hi there.
I have adopted an approach to the "Fuzzy Logic" matching as follows.
I have created a separate SQLite database, which I attach to the MM database when the script runs. It stores the full history of the Last FM played list. When it imports a new item, it fist of all looks it up on the MM database, and if it doesn't find it, it looks it up on the new SQLite database, to see if it's been processed before. If it has, that gives it the "mapping" if you like, to the MM track details. If it's the first time it's been played (or potentially LastFM has auto-corrected it to something else) it opens up an ActiveX control that lists first the possible artists (from MM), then the possible albums, and then the possible tracks. Any of those last steps are missed out if the LastFM details match the artist, album, or track name exactly. When the user identifies the correct track, the new table is updated, and thence if it ever comes up again, the script auto-corrects.
The script occasionally cross-checks the total number of plays in the MM database at a track level, with the new history table, and overrides those on MM if they have got out of step. This caters for scenarios where a mobile device scrobbles only when connected to WiFi, but in the meantime Sonos is scrobbling constantly - but it could also cater for the scenario where MM is scrobbling, so preventing double counting.
The ActiveX control is fairly simple, but I am not sure how easy it would be to distribute, given that it was created with VB Express (2010), and it doesn't seem to be possible to create a distribution package for dll's.
Anyway, it's an idea, and it has been working well for me for the last few days.
Jules