Skip to content

Commit

Permalink
Merge pull request #40 from Erotemic/identify_api
Browse files Browse the repository at this point in the history
Identify api
  • Loading branch information
iwalton3 authored Jan 21, 2024
2 parents 2fba159 + e20d175 commit 58cb6e7
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion jellyfin_apiclient_python/api.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -823,8 +827,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.
Expand Down

0 comments on commit 58cb6e7

Please sign in to comment.