diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/MANIFEST.in b/MANIFEST.in old mode 100755 new mode 100644 diff --git a/README.rst b/README.rst old mode 100755 new mode 100644 diff --git a/connect/__init__.py b/connect/__init__.py old mode 100755 new mode 100644 diff --git a/connect/artist.py b/connect/artist.py old mode 100755 new mode 100644 diff --git a/connect/client.py b/connect/client.py old mode 100755 new mode 100644 diff --git a/connect/errors.py b/connect/errors.py old mode 100755 new mode 100644 diff --git a/connect/http.py b/connect/http.py old mode 100755 new mode 100644 diff --git a/connect/playlist.py b/connect/playlist.py old mode 100755 new mode 100644 diff --git a/connect/release.py b/connect/release.py old mode 100755 new mode 100644 diff --git a/connect/track.py b/connect/track.py old mode 100755 new mode 100644 index 9067093..6bf7056 --- a/connect/track.py +++ b/connect/track.py @@ -61,8 +61,9 @@ class Track: """ __slots__ = ( - 'id', 'artists', 'title', 'duration', 'bpm', 'genre', 'genres', 'tags', 'is_downloadable', 'is_streamable', 'in_early_access', - 'is_free', '_albums_raw', '_artists_raw', '_featuring_raw', '_remixers_raw', '_albums', '_artists', '_featuring', '_remixers' + 'id', 'artists', 'title', 'duration', 'bpm', 'primary_genre', 'secondary_genre', 'tags', 'is_downloadable', 'is_streamable', + 'in_early_access', 'is_free', '_albums_raw', '_artists_raw', '_remixers_raw', '_featuring_raw', '_albums', '_artists', + '_featuring', '_remixers' ) def __init__(self, **kwargs): @@ -73,15 +74,15 @@ def __init__(self, **kwargs): bpm = kwargs.pop('bpm', None) self.duration = None if not duration else round(duration) self.bpm = None if not bpm else round(bpm) - self.genre = kwargs.pop('genre', None) - self.genres = kwargs.pop('genres') + self.primary_genre = kwargs.pop('genrePrimary') + self.secondary_genre = kwargs.pop('genreSecondary', None) self.tags = kwargs.pop('tags') self.is_downloadable = kwargs.pop('downloadable', None) self.is_streamable = kwargs.pop('streamable', None) self.in_early_access = kwargs.pop('inEarlyAccess', None) self.is_free = kwargs.pop('freeDownloadForUsers', None) + self._artists_raw = kwargs.pop('artistRelationships') self._albums_raw = kwargs.pop('albums') - self._artists_raw = kwargs.pop('artists') self._featuring_raw = kwargs.pop('featuring') self._remixers_raw = kwargs.pop('remixers') self._albums = {} diff --git a/connect/utils.py b/connect/utils.py old mode 100755 new mode 100644 diff --git a/requirements.txt b/requirements.txt old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 diff --git a/tests/__init__.py b/tests/__init__.py old mode 100755 new mode 100644 diff --git a/tests/test_get_all_catalog.py b/tests/test_get_all_catalog.py old mode 100755 new mode 100644 diff --git a/tests/test_get_catalog.py b/tests/test_get_catalog.py old mode 100755 new mode 100644 diff --git a/tests/test_search.py b/tests/test_search.py old mode 100755 new mode 100644 index 85ed060..934b3f2 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -33,7 +33,7 @@ def setUp(self): self.connect = connect.Client() def test_release(self): - releases = self.connect.search_release('friends') + releases = self.connect.search_release('friends ep') print('\n[connect.Client.search_release] Found the following:') for release in releases: print(f'[{release.catalog_id}] Released on {release.release_date}, has {len(release.tracks)} track(s) and with the title {release.title}') @@ -50,14 +50,14 @@ def test_track(self): tracks = self.connect.search_track('you') print('\n[connect.Client.search_track] Found the following:') for track in tracks: - print(f'{track.title} by {track.artists} with the genre(s) {", ".join(track.genres)} and featured on {len(track.albums)} release(s)') + print(f'{track.title} by {track.artists} with the genre {track.primary_genre} and featured on {len(track.albums)} release(s)') self.assertEqual(tracks[0], self.connect.get_track('5175cd4e0695c7ac5d000033')) def test_track_adv(self): tracks = self.connect.search_track_advanced('Do You Don\'t You', 'Haywyre') print('\n[connect.Client.search_track_advanced] Found the following:') for track in tracks: - print(f'{track.title} by {track.artists} with the genre(s) {", ".join(track.genres)} and featured on {len(track.albums)} release(s)') + print(f'{track.title} by {track.artists} with the genre {track.primary_genre} and featured on {len(track.albums)} release(s)') self.assertEqual(tracks[0], self.connect.get_track('56a2773c5050dd875854cf85')) def test_artist(self):