diff --git a/jellyfin_apiclient_python/api.py b/jellyfin_apiclient_python/api.py index a0a06e8..eb7bc26 100644 --- a/jellyfin_apiclient_python/api.py +++ b/jellyfin_apiclient_python/api.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +""" +For API info see: + https://api.jellyfin.org/ +""" from typing import List from datetime import datetime import requests @@ -796,8 +800,35 @@ def new_sync_play_v2(self, group_name): }) +class ExperimentalAPIMixin: + """ + This is a location for testing proposed additions to the API Client. + """ + + def identify(client, item_id, provider_ids): + """ + Remote search for item metadata given one or more provider id. + + This method requires an authenticated user with elevated permissions + [RemoveProviderSearch]_. + + Args: + item_id (str): item uuid to identify and update metadata for. + + provider_ids (Dict): + maps providers to the content id. (E.g. {"Imdb": "tt1254207"}) + Valid keys will depend on available providers. Common ones are: + "Tvdb" and "Imdb". + + References: + .. [RemoveProviderSearch] https://api.jellyfin.org/#tag/ItemLookup/operation/ApplySearchCriteria + """ + body = {'ProviderIds': provider_ids} + return client.jellyfin.items('/RemoteSearch/Apply/' + item_id, action='POST', params=None, json=body) + + class API(InternalAPIMixin, BiggerAPIMixin, GranularAPIMixin, - SyncPlayAPIMixin): + SyncPlayAPIMixin, ExperimentalAPIMixin): """ The Jellyfin Python API client containing all api calls to the server.