Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified LICENSE
100755 → 100644
Empty file.
Empty file modified MANIFEST.in
100755 → 100644
Empty file.
Empty file modified README.rst
100755 → 100644
Empty file.
Empty file modified connect/__init__.py
100755 → 100644
Empty file.
Empty file modified connect/artist.py
100755 → 100644
Empty file.
Empty file modified connect/client.py
100755 → 100644
Empty file.
Empty file modified connect/errors.py
100755 → 100644
Empty file.
Empty file modified connect/http.py
100755 → 100644
Empty file.
Empty file modified connect/playlist.py
100755 → 100644
Empty file.
Empty file modified connect/release.py
100755 → 100644
Empty file.
11 changes: 6 additions & 5 deletions connect/track.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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 = {}
Expand Down
Empty file modified connect/utils.py
100755 → 100644
Empty file.
Empty file modified requirements.txt
100755 → 100644
Empty file.
Empty file modified setup.py
100755 → 100644
Empty file.
Empty file modified tests/__init__.py
100755 → 100644
Empty file.
Empty file modified tests/test_get_all_catalog.py
100755 → 100644
Empty file.
Empty file modified tests/test_get_catalog.py
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions tests/test_search.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand All @@ -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):
Expand Down