jellyfin.generated.api_10_10.CollectionApi
All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
add_to_collection | POST /Collections/{collectionId}/Items | Adds items to a collection. |
create_collection | POST /Collections | Creates a new collection. |
remove_from_collection | DELETE /Collections/{collectionId}/Items | Removes items from a collection. |
add_to_collection
add_to_collection(collection_id, ids)
Adds items to a collection.
Example
- Api Key Authentication (CustomAuthentication):
import jellyfin.generated.api_10_10
from jellyfin.generated.api_10_10 import ApiClient, Configuration
from jellyfin.generated.api_10_10.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration(
host = "http://localhost"
)
# Configure API key authorization: CustomAuthentication
configuration.api_key['CustomAuthentication'] = f'Token="{os.getenv("API_KEY")}"'
configuration.api_key_prefix['CustomAuthentication'] = "MediaBrowser"
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = jellyfin.generated.api_10_10.CollectionApi(api_client)
collection_id = 'collection_id_example' # str | The collection id.
ids = ['ids_example'] # List[str] | Item ids, comma delimited.
try:
# Adds items to a collection.
api_instance.add_to_collection(collection_id, ids)
except Exception as e:
print("Exception when calling CollectionApi->add_to_collection: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
collection_id | str | The collection id. | |
ids | List[str] | Item ids, comma delimited. |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | Items added to collection. | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create_collection
CollectionCreationResult create_collection(name=name, ids=ids, parent_id=parent_id, is_locked=is_locked)
Creates a new collection.
Example
- Api Key Authentication (CustomAuthentication):
import jellyfin.generated.api_10_10
from jellyfin.generated.api_10_10 import ApiClient, Configuration
from jellyfin.generated.api_10_10.models.collection_creation_result import CollectionCreationResult
from jellyfin.generated.api_10_10.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration(
host = "http://localhost"
)
# Configure API key authorization: CustomAuthentication
configuration.api_key['CustomAuthentication'] = f'Token="{os.getenv("API_KEY")}"'
configuration.api_key_prefix['CustomAuthentication'] = "MediaBrowser"
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = jellyfin.generated.api_10_10.CollectionApi(api_client)
name = 'name_example' # str | The name of the collection. (optional)
ids = ['ids_example'] # List[str] | Item Ids to add to the collection. (optional)
parent_id = 'parent_id_example' # str | Optional. Create the collection within a specific folder. (optional)
is_locked = False # bool | Whether or not to lock the new collection. (optional) (default to False)
try:
# Creates a new collection.
api_response = api_instance.create_collection(name=name, ids=ids, parent_id=parent_id, is_locked=is_locked)
print("The response of CollectionApi->create_collection:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CollectionApi->create_collection: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
name | str | The name of the collection. | [optional] |
ids | List[str] | Item Ids to add to the collection. | [optional] |
parent_id | str | Optional. Create the collection within a specific folder. | [optional] |
is_locked | bool | Whether or not to lock the new collection. | [optional] [default to False] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/json; profile="CamelCase", application/json; profile="PascalCase"
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Collection created. | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
remove_from_collection
remove_from_collection(collection_id, ids)
Removes items from a collection.
Example
- Api Key Authentication (CustomAuthentication):
import jellyfin.generated.api_10_10
from jellyfin.generated.api_10_10 import ApiClient, Configuration
from jellyfin.generated.api_10_10.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration(
host = "http://localhost"
)
# Configure API key authorization: CustomAuthentication
configuration.api_key['CustomAuthentication'] = f'Token="{os.getenv("API_KEY")}"'
configuration.api_key_prefix['CustomAuthentication'] = "MediaBrowser"
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = jellyfin.generated.api_10_10.CollectionApi(api_client)
collection_id = 'collection_id_example' # str | The collection id.
ids = ['ids_example'] # List[str] | Item ids, comma delimited.
try:
# Removes items from a collection.
api_instance.remove_from_collection(collection_id, ids)
except Exception as e:
print("Exception when calling CollectionApi->remove_from_collection: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
collection_id | str | The collection id. | |
ids | List[str] | Item ids, comma delimited. |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | Items removed from collection. | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]