Skip to content

Commit

Permalink
Add identify method
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Jan 8, 2024
1 parent fa08e4a commit ffeac69
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 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 @@ -853,6 +857,24 @@ def get_now_playing(self, session_id):
now_playing['PlayState'] = play_state
return now_playing

def identify(client, item_id, provider_ids):
"""
Remote search for item metadata given one or more provider id.
This method requires the user have appropriate permissions
Args:
item_id (str): item uuid to identify
provider_ids (Dict):
maps providers to the content id. (E.g. {"Imdb": "tt1254207"})
References:
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):
Expand Down

0 comments on commit ffeac69

Please sign in to comment.