Konsl / spicetify-extensions

My Extensions for Spotify
MIT License
17 stars 0 forks source link

feat(Find Duplicates) Add number indicators beside like button for liked duplicates amount #1

Closed karimawi closed 1 year ago

karimawi commented 1 year ago

I know it's quite a bit of work, but it'd be really useful, adding plugin settings in the user menu, that takes in a client ID and secret (I don't think you can use normal access tokens since you want to access user data) so that you can use Spotify's API "Search" endpoint to get and search the isrc code, get the results, and check if any of the duplicates are liked with the "Check User's Saved Tracks" endpoint and then add a number next to the like button (kinda like Star Ratings) that indicates how many duplicates are liked:

image it's probably a lot of requests, so you'd need to make a wait in the loop so you can slowly get and cache the stats of a playlist or album, you may also make the number hyperlinked to the search URL (like where the current version redirects), if you tried it out and found that it frequently hits the rate limit, you may add it to the playback section instead (kinda like Spicetify Genre) that'd be easier on their servers.

Thanks

Konsl commented 1 year ago

I think I'll just store a list of all saved tracks together with their ISRCs and then just compare the ISRCs of the tracks on the screen against that list. Doing it this way will probably require less requests and therefore be faster. (max. 1 request per track on the screen)

karimawi commented 1 year ago

Yeah, that would be great, iirc there's a limit of 50 tracks and then you'd have to paginate, but I think you can deal with that and have no issues. Looking forward to see it.

Thanks a lot