Hello and congratulations for your amazing work!
Inspired by the BeatportTagger project, I started my own tagger earlier this year, because I wanted to create a similar project which would allow me to get metadata from Spotify/AppleMusic (iTunes) too. Unfortunately, I had to focus on other things and stopped the project, but I implemented a few things which could be easily ported to this OneTagger version. I currently don't have time to get involved in this project, but i'll definitively do in the future since I find it a very useful and necessary tool for DJs! Anyway, here are a couple of suggestions:
- Ability to choose wether to overwrite each specific field/tag.
To overwrite all tags may not always be a feasable option. Imagine you only want to overwrite the Genre Tag but also want to fill the missing release dates. Right now you need to do the process 2 times, which is rather uneffecitve. I can add a screenshot of how I had it done (in terms of UI), but I believe it would be a good approach to let users chose if they want to overwrite all fields, or just some of them.
- Search engine
I modified the search engine algorithm to have some even better results (haven't checked the current algorithm/code yet):
The idea was to get, on one hand, the "clean" title + (re)mix, and on the other hand, the artist + remixer + featurers, in order to use all this info in a better way, rather than using the Title/Artist in a generic way. To get all that info, I would try to read it from the tags themselves, using regex expressions to get them from the title/artist fields of the local & server files/tracks.
You'll find the functions in the "helper.py" file inside the attached ZIP file. Here's my suggested Search engine, which you'll also be able to find inside the itunes/spotify/beatport.py files.
API Tagger.zip
# Start match process
for track in results:
# Create track object for each result
track = Track(result)
# Title match
if fuzz.ratio(metadata.title, track.title) >= fuzzywuzzy_ratio:
# Duration match
if abs(metadata.duration - track.duration) <= timeTolerance:
# Artists match
if fuzz.ratio(metadata.artists, track.artists) >= fuzzywuzzy_ratio:
return track
# Main artists + featurers match
elif fuzz.token_sort_ratio(', '.join(metadata.mainArtists), ', '.join(track.mainArtists)) >= fuzzywuzzy_ratio and fuzz.token_sort_ratio(', '.join(metadata.featuringArtists), ', '.join(track.featuringArtists)) >= fuzzywuzzy_ratio:
return track
# Main artists + remixer match
elif fuzz.token_sort_ratio(', '.join(metadata.mainArtists), ', '.join(track.mainArtists)) >= fuzzywuzzy_ratio and fuzz.token_sort_ratio(metadata.remixer, track.remixer) >= fuzzywuzzy_ratio:
# Duration match
if abs(metadata.duration - track.duration) <= timeTolerance:
return track
else:
continue
# Name match
elif fuzz.ratio(metadata.name, track.name) >= fuzzywuzzy_ratio:
# Mix match
if fuzz.ratio(metadata.mix, track.mix) >= fuzzywuzzy_ratio or (metadata.mix == '' and track.mix == 'Original Mix'):
# Duration match
if abs(metadata.duration - track.duration) <= timeTolerance:
# Artists match
if fuzz.ratio(metadata.artists, track.artists) >= fuzzywuzzy_ratio:
return track
# Main artists + featurers match
if fuzz.token_sort_ratio(', '.join(metadata.mainArtists), ', '.join(track.mainArtists)) >= fuzzywuzzy_ratio and fuzz.token_sort_ratio(', '.join(metadata.featuringArtists), ', '.join(track.featuringArtists)) >= fuzzywuzzy_ratio:
return track
# Main artists + remixer match
elif fuzz.token_sort_ratio(', '.join(metadata.mainArtists), ', '.join(track.mainArtists)) >= fuzzywuzzy_ratio and fuzz.token_sort_ratio(metadata.remixer, track.remixer) >= fuzzywuzzy_ratio:
return track
else:
continue
# Original/API track doesn't have mix info
elif metadata.mix == '' or track.mix == '':
# Duration match
if abs(metadata.duration - track.duration) <= timeTolerance:
# Artists match
if fuzz.ratio(metadata.artists, track.artists) >= fuzzywuzzy_ratio:
return track
# Main artists + featurers match
if fuzz.token_sort_ratio(', '.join(metadata.mainArtists), ', '.join(track.mainArtists)) >= fuzzywuzzy_ratio and fuzz.token_sort_ratio(', '.join(metadata.featuringArtists), ', '.join(track.featuringArtists)) >= fuzzywuzzy_ratio:
return track
# Main artists + remixer match
elif fuzz.token_sort_ratio(', '.join(metadata.mainArtists), ', '.join(track.mainArtists)) >= fuzzywuzzy_ratio and fuzz.token_sort_ratio(metadata.remixer, track.remixer) >= fuzzywuzzy_ratio:
return track
else:
continue
- Explicit Spotify support + iTunes API
I'd love to fetch some data from the Spotify API or the "free" iTunes API (limits the number of request/time, just as discogs I believe). Feel free to check my spotify.py/itunes.py code :)
Finally, in the future, I'd love to see the app using OAuth in order to use properly Beatport's API + other APIs (such as Spotify API/AppleMusic/Tidal or other APIs). And also, as a Traktor user, I'd love to read and modify the collection.nml to fill the Mix/Remixer field... I believe that this would make the app an even more DJ focused app for tag editing! And using the functions above to extract all that, we could definitively make it work!