-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d97704
commit 6c8ab57
Showing
29 changed files
with
851 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from tekore.client.api.album import SpotifyAlbum | ||
from tekore.client.api.artist import SpotifyArtist | ||
from tekore.client.api.browse import SpotifyBrowse | ||
from tekore.client.api.episode import SpotifyEpisode | ||
from tekore.client.api.follow import SpotifyFollow | ||
from tekore.client.api.library import SpotifyLibrary | ||
from tekore.client.api.personalisation import SpotifyPersonalisation | ||
from tekore.client.api.player import SpotifyPlayer | ||
from tekore.client.api.playlist import SpotifyPlaylist | ||
from tekore.client.api.search import SpotifySearch | ||
from tekore.client.api.show import SpotifyShow | ||
from tekore.client.api.track import SpotifyTrack | ||
from tekore.client.api.user import SpotifyUser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from tekore.client.process import single, model_list | ||
from tekore.client.chunked import chunked, join_lists | ||
from tekore.client.decor import send_and_process | ||
from tekore.client.base import SpotifyBase | ||
from tekore.serialise import ModelList | ||
from tekore.model import FullEpisode | ||
|
||
|
||
class SpotifyEpisode(SpotifyBase): | ||
@send_and_process(single(FullEpisode)) | ||
def episode( | ||
self, | ||
episode_id: str, | ||
market: str = None | ||
) -> FullEpisode: | ||
""" | ||
Get information for an episode. | ||
Parameters | ||
---------- | ||
episode_id | ||
episode ID | ||
market | ||
an ISO 3166-1 alpha-2 country code. | ||
If a user token is used to authenticate, the country associated | ||
with it overrides this parameter. | ||
If an application token is used and no market is specified, | ||
the episode is considered unavailable. | ||
Returns | ||
------- | ||
FullEpisode | ||
episode object | ||
""" | ||
return self._get('episodes/' + episode_id, market=market) | ||
|
||
@chunked('episode_ids', 1, 50, join_lists) | ||
@send_and_process(model_list(FullEpisode, 'episodes')) | ||
def episodes( | ||
self, | ||
episode_ids: list, | ||
market: str = None | ||
) -> ModelList: | ||
""" | ||
Get information for multiple episodes. | ||
Parameters | ||
---------- | ||
episode_ids | ||
the episode IDs, max 50 without chunking | ||
market | ||
an ISO 3166-1 alpha-2 country code. | ||
If a user token is used to authenticate, the country associated | ||
with it overrides this parameter. | ||
If an application token is used and no market is specified, | ||
the episode is considered unavailable. | ||
Returns | ||
------- | ||
ModelList | ||
list of episode objects | ||
""" | ||
return self._get('episodes/?ids=' + ','.join(episode_ids), market=market) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.