User
User(subsonic, username, password=None, email=None, ldap_authenticated=None, admin_role=None, settings_role=None, stream_role=None, jukebox_role=None, download_role=None, upload_role=None, playlist_role=None, cover_art_role=None, comment_role=None, podcast_role=None, share_role=None, video_conversion_role=None, music_folder_id=None, max_bit_rate=None)
Bases: Model
Object that holds all the info about a user.
Attributes:
Name | Type | Description |
---|---|---|
username |
str
|
The username of the user. |
password |
str | None
|
The password of the user. |
email |
str | None
|
The email of the user. |
ldap_authenticated |
bool | None
|
If the user is has been authenticated using LDAP. |
admin_role |
bool | None
|
If the user has access to admin functionalities. |
settings_role |
bool | None
|
If the user has access to change the settings of the server. |
stream_role |
bool | None
|
If the user has access to stream media. |
jukebox_role |
bool | None
|
If the user has access to control the jukebox. |
download_role |
bool | None
|
If the user has access to download media. |
upload_role |
bool | None
|
If the user has access to upload media. |
playlist_role |
bool | None
|
If the user has access to create, edit and delete playlists. |
cover_art_role |
bool | None
|
If the user has access to manipulate cover arts of media. |
comment_role |
bool | None
|
If the user has access to manipulate comments. |
podcast_role |
bool | None
|
If the user has access to manipulate podcasts. |
share_role |
bool | None
|
If the user has access to create, modify and delete shares. |
video_conversion_role |
bool | None
|
If the user is able to trigger video conversions. |
music_folder_id |
list[str] | None
|
The IDs of the music folders where the user is able to access content from. |
max_bit_rate |
int | None
|
The max bit rate the user can stream. |
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_user.py
change_password(new_password)
Change the password of the user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_password |
str
|
The new password for the user |
required |
Returns:
Type | Description |
---|---|
Self
|
The object itself. |
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_user.py
create()
Create a new user with the attributes of the model.
Raises:
Type | Description |
---|---|
MissingRequiredProperty
|
Raised if a required property to create the user is missing. |
Returns: The object itself.
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_user.py
delete()
Delete the user from the server.
Returns:
Type | Description |
---|---|
Self
|
The object itself. |
generate()
Return a new user object with all the data updated from the API, using the endpoint that return the most information possible.
Useful for making copies with updated data or updating the object
itself with immutability, e.g., foo = foo.generate()
.
Returns:
Type | Description |
---|---|
User
|
A new object with all the updated info. |
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_user.py
update()
Updates the info about the user in the server with the one in the model.
Returns:
Type | Description |
---|---|
Self
|
The object itself. |