-
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.
Podcast endpoints, library, search and player
- Loading branch information
1 parent
863e3a3
commit 1af3152
Showing
25 changed files
with
653 additions
and
75 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
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,55 @@ | ||
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 | ||
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 | ||
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
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.