mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Add missing show/season ids on episode/season refresh
This commit is contained in:
parent
3e5007de75
commit
5a6da7441f
@ -172,23 +172,36 @@ class Matcher:
|
|||||||
kind: Literal["collection", "movie", "episode", "show", "season"],
|
kind: Literal["collection", "movie", "episode", "show", "season"],
|
||||||
kyoo_id: str,
|
kyoo_id: str,
|
||||||
):
|
):
|
||||||
|
async def id_season(season: dict, id: dict):
|
||||||
|
ret = await self._provider.identify_season(
|
||||||
|
id["dataId"], season["seasonNumber"]
|
||||||
|
)
|
||||||
|
ret.show_id = season["showId"]
|
||||||
|
return ret
|
||||||
|
|
||||||
|
async def id_episode(episode: dict, id: dict):
|
||||||
|
ret = await self._provider.identify_episode(
|
||||||
|
id["showId"], id["season"], id["episode"], episode["absoluteNumber"]
|
||||||
|
)
|
||||||
|
ret.show_id = episode["showId"]
|
||||||
|
ret.season_id = episode["seasonId"]
|
||||||
|
ret.path = episode["path"]
|
||||||
|
return ret
|
||||||
|
|
||||||
identify_table = {
|
identify_table = {
|
||||||
"collection": lambda _, id: self._provider.identify_collection(
|
"collection": lambda _, id: self._provider.identify_collection(
|
||||||
id["dataId"]
|
id["dataId"]
|
||||||
),
|
),
|
||||||
"movie": lambda _, id: self._provider.identify_movie(id["dataId"]),
|
"movie": lambda _, id: self._provider.identify_movie(id["dataId"]),
|
||||||
"show": lambda _, id: self._provider.identify_show(id["dataId"]),
|
"show": lambda _, id: self._provider.identify_show(id["dataId"]),
|
||||||
"season": lambda season, id: self._provider.identify_season(
|
"season": id_season,
|
||||||
id["dataId"], season["seasonNumber"]
|
"episode": id_episode,
|
||||||
),
|
|
||||||
"episode": lambda episode, id: self._provider.identify_episode(
|
|
||||||
id["showId"], id["season"], id["episode"], episode["absoluteNumber"]
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
current = await self._client.get(kind, kyoo_id)
|
current = await self._client.get(kind, kyoo_id)
|
||||||
if self._provider.name not in current["externalId"]:
|
if self._provider.name not in current["externalId"]:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"Could not refresh metadata of {kind}/{kyoo_id}. Missisg provider id."
|
f"Could not refresh metadata of {kind}/{kyoo_id}. Missing provider id."
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
provider_id = current["externalId"][self._provider.name]
|
provider_id = current["externalId"][self._provider.name]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user