JS script that allows you to remove duplicates from your Last.fm scrobbles library.
This script allows you to remove duplicates from your Last.fm scrobbles library. Why is this tool better than other similar ones? Because it's smart: it can handle not only the situation when the same song was scrobbled multiple times in a row but also more complicated cases e.g., when duplicates were added a bit later (it's a common situation if you're using Spotify and Last.fm and have mistakenly set up scrobbling on both sides. Also, it has 3 modes: from absolutely safe (allowing you to make all the choices by yourself) to independent silent mode.
Scrobbles Library
(https://www.last.fm/user/%USERNAME%/library
)F12
for Chrome) and press Enter
to run itUp
and Enter
in the console to run the script once again).You can run the script using 3 different modes depending on how accurate results you want to get or how much time you're ready to spend.
MODE code | Name | Accuracy | How it works |
---|---|---|---|
0 | silent | >95% | All the found duplicates (even uncertain) will be deleted immediately. Use this mode only if you want to go the most comfortable way of deduplication, and you don't need very high accuracy. |
1 | balanced* | >99% | The duplicates, which unmistakably are duplicates, will be deleted immediately. All the uncertain cases will be marked with the Delete button so that you can make the right decision. |
2 | safe | 100% | For the most watchful :eyes: users—you'll always be given a choice. If you have enough time and healthy nerves, use it. |
* recommended
Bookmarking is much more convenient than using a console, so it worth creating a bookmark once you've chosen the most suitable mode for you.
Bookmarks Bar
and choose Add Page...
URL
field (make sure it begins with javascript:
).Save
The script has a few parameters which define its behavior. You can fine-tune it by changing the following constants at the beginning of the script:
Parameter name | Default value | Meaning |
---|---|---|
MODE | 1 | Read Script modes section |
CACHE_MAX_SIZE | 4 | If the positional distance (including) between two scrobbles is greater, they will not be considered as duplicates. Set it to 2 if you want to clean-up only neighboring duplicates (this way the script would work like the other ones you can find on the Internet) |
MAX_DIFF_MINS | 15 | If the time difference (in minutes) between two scrobbles is greater, they will not be considered as duplicates. Try to analyze your cases and set this parameter appropriately. |
MIN_SCROBBLE_TIME_MINS | 1 | If the time difference (in minutes) between the same songs is less, they will be undoubtedly considered as duplicates. If you're a grindcore (as well as other genres with a lot of "micro songs") lover, it's recommended to set it to 0. |
SAME_NEIGHBOURS_ARE_ALWAYS_DUPLICATES | FALSE | The script is smart enough to distinguish the cases when you were playing some song repeatedly (such duplicates are treated as uncertain). Set it to TRUE if you want such duplicates to be always treated as certain duplicates (this way, the script would work like the other ones you can find on the Internet). |