playlists_controller = client.playlists
PlaylistsController
Adds items to a playlist.
def add_to_playlist(self,
playlist_id,
ids=None,
user_id=None)
Parameter |
Type |
Tags |
Description |
playlist_id |
uuid|string |
Template, Required |
The playlist id. |
ids |
List of uuid|string |
Query, Optional |
Item id, comma delimited. |
user_id |
uuid|string |
Query, Optional |
The userId. |
void
playlist_id = '00001160-0000-0000-0000-000000000000'
result = playlists_controller.add_to_playlist(playlist_id)
HTTP Status Code |
Error Description |
Exception Class |
401 |
Unauthorized |
APIException |
403 |
Forbidden |
APIException |
For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.
Query parameters are obsolete.
def create_playlist(self,
name=None,
ids=None,
user_id=None,
media_type=None,
body=None)
Parameter |
Type |
Tags |
Description |
name |
string |
Query, Optional |
The playlist name. |
ids |
List of uuid|string |
Query, Optional |
The item ids. |
user_id |
uuid|string |
Query, Optional |
The user id. |
media_type |
string |
Query, Optional |
The media type. |
body |
CreatePlaylistDto |
Body, Optional |
The create playlist payload. |
PlaylistCreationResult
result = playlists_controller.create_playlist()
HTTP Status Code |
Error Description |
Exception Class |
401 |
Unauthorized |
APIException |
403 |
Forbidden |
APIException |
Gets the original items of a playlist.
def get_playlist_items(self,
playlist_id,
user_id,
start_index=None,
limit=None,
fields=None,
enable_images=None,
enable_user_data=None,
image_type_limit=None,
enable_image_types=None)
Parameter |
Type |
Tags |
Description |
playlist_id |
uuid|string |
Template, Required |
The playlist id. |
user_id |
uuid|string |
Query, Required |
User id. |
start_index |
int |
Query, Optional |
Optional. The record index to start at. All items with a lower index will be dropped from the results. |
limit |
int |
Query, Optional |
Optional. The maximum number of records to return. |
fields |
List of ItemFieldsEnum |
Query, Optional |
Optional. Specify additional fields of information to return in the output. |
enable_images |
bool |
Query, Optional |
Optional. Include image information in output. |
enable_user_data |
bool |
Query, Optional |
Optional. Include user data. |
image_type_limit |
int |
Query, Optional |
Optional. The max number of images to return, per image type. |
enable_image_types |
List of ImageTypeEnum |
Query, Optional |
Optional. The image types to include in the output. |
BaseItemDtoQueryResult
playlist_id = '00001160-0000-0000-0000-000000000000'
user_id = '000013ec-0000-0000-0000-000000000000'
result = playlists_controller.get_playlist_items(playlist_id, user_id)
HTTP Status Code |
Error Description |
Exception Class |
401 |
Unauthorized |
APIException |
403 |
Forbidden |
APIException |
404 |
Playlist not found. |
APIException |
Moves a playlist item.
def move_item(self,
playlist_id,
item_id,
new_index)
Parameter |
Type |
Tags |
Description |
playlist_id |
string |
Template, Required |
The playlist id. |
item_id |
string |
Template, Required |
The item id. |
new_index |
int |
Template, Required |
The new index. |
void
playlist_id = 'playlistId8'
item_id = 'itemId8'
new_index = 60
result = playlists_controller.move_item(playlist_id, item_id, new_index)
HTTP Status Code |
Error Description |
Exception Class |
401 |
Unauthorized |
APIException |
403 |
Forbidden |
APIException |
Removes items from a playlist.
def remove_from_playlist(self,
playlist_id,
entry_ids=None)
Parameter |
Type |
Tags |
Description |
playlist_id |
string |
Template, Required |
The playlist id. |
entry_ids |
List of string |
Query, Optional |
The item ids, comma delimited. |
void
playlist_id = 'playlistId8'
result = playlists_controller.remove_from_playlist(playlist_id)
HTTP Status Code |
Error Description |
Exception Class |
401 |
Unauthorized |
APIException |
403 |
Forbidden |
APIException |