Playlists
Playlists(api, subsonic)
Class that contains all the methods needed to interact with the playlists endpoints in the Subsonic API.
Source code in .venv/lib/python3.11/site-packages/knuckles/_playlists.py
create_playlist(name, comment=None, public=None, song_ids=None)
Create a new playlist for the authenticated user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the playlist to be created. |
required |
comment |
str | None
|
A comment to be added to the new created playlist. |
None
|
public |
bool | None
|
If the song should be public or not. |
None
|
song_ids |
list[str] | None
|
A list of ID of the songs that should be included with the playlist. |
None
|
Returns:
Type | Description |
---|---|
Playlist
|
An object that holds all the info about the new created playlist. |
Source code in .venv/lib/python3.11/site-packages/knuckles/_playlists.py
delete_playlist(playlist_id)
Delete a playlist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playlist_id |
str
|
The ID of the playlist to remove. |
required |
Returns:
Type | Description |
---|---|
Subsonic
|
The Subsonic object where this method was called to allow method chaining. |
Source code in .venv/lib/python3.11/site-packages/knuckles/_playlists.py
get_playlist(playlist_id)
Get all the info about a playlist available for the authenticated user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playlist_id |
str
|
The ID of the playlist to get its info. |
required |
Returns:
Type | Description |
---|---|
Playlist
|
An object that holds all the info about the requested playlist. |
Source code in .venv/lib/python3.11/site-packages/knuckles/_playlists.py
get_playlists(username=None)
Get all the playlists available to the authenticated user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
str | None
|
The username of another user if is wanted to get the playlists they can access. |
None
|
Returns:
Type | Description |
---|---|
list[Playlist]
|
A list that holds all the info about all the playlist that the user can play. |
Source code in .venv/lib/python3.11/site-packages/knuckles/_playlists.py
update_playlist(playlist_id, name=None, comment=None, public=None, song_ids_to_add=None, song_indexes_to_remove=None)
Update the info of a playlist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
playlist_id |
str
|
The ID of the playlist to update its info. |
required |
name |
str | None
|
A new name for the playlist. |
None
|
comment |
str | None
|
A new comment for the playlist. |
None
|
public |
bool | None
|
Change if the playlist should be public or private. |
None
|
song_ids_to_add |
list[str] | None
|
A list of IDs of new songs to be added to the playlist. |
None
|
song_indexes_to_remove |
list[int] | None
|
A list in indexes of songs that should be removed from the playlist. |
None
|
Returns:
Type | Description |
---|---|
Playlist
|
An object that holds all the info about the updated playlist. |