Share
Share(subsonic, id, url=None, description=None, username=None, created=None, expires=None, lastVisited=None, visitCount=None, entry=None)
Bases: Model
Object that holds all the info about a share.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
The ID of the share. |
url |
str | None
|
The URL to access the shared media. |
description |
str | None
|
The description of the share. |
user |
User | None
|
All the info related with the user creator of the share. |
created |
datetime | None
|
The timestamp when the share was created. |
expires |
datetime | None
|
The timestamp when the share will expire. |
last_visited |
datetime | None
|
The timestamp when the share was last visited. |
visit_count |
int | None
|
Number of times the share has been visited. |
songs |
list[Song] | None
|
List that holds all the info about all the songs available to access with the share. |
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_share.py
create()
Create a new share with the same info of the current one.
Raises:
Type | Description |
---|---|
ShareInvalidSongList
|
Raised if the song list contained in the share is empty. |
Returns:
Type | Description |
---|---|
Share
|
The new created share. |
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_share.py
delete()
Delete the share from the server.
Returns:
Type | Description |
---|---|
Self
|
The object itself. |
generate()
Return a new share 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 |
---|---|
Share | None
|
A new object with all the updated info. |
Source code in .venv/lib/python3.11/site-packages/knuckles/models/_share.py
update()
Update the info of the share with the one in the model.
Returns:
Type | Description |
---|---|
Self
|
The object itself. |