rckclmbr / pyportify

App to transfer your spotify playlists to Google Play Music
Apache License 2.0
779 stars 58 forks source link

Increase track match accuracy #132

Closed chrispouliot closed 6 years ago

chrispouliot commented 6 years ago

This Pull Request increases the accuracy of track matches, and addresses issue https://github.com/rckclmbr/pyportify/issues/76

I have added a new Track object in a serializers.py file in order to keep the matching code decoupled from GPM/Spotify, as well as not adding any additional coupling with my modifications of the google/spotify api files. Both these two files are still as generic as before, but the search_gm_track function in app.py now serializes the tracks it gets back from GPM and finds the best match by using a new util function.

The tracks are matched based on artist name first, then based on track name. This means that a track named "Best Song (Ft. Me)" by artist "Dave" will be matched to a song on GPM like "Best Song - Ft Me" by "Dave", instead of a different artist who has a track with a name that more closely matches the original.

I have also added tests to make sure the functionality works as expected.

rckclmbr commented 6 years ago

Awesome contribution, thanks a lot @moxuz