mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-02 21:24:20 -04:00
Fix provider circular ref and xem id lookup
This commit is contained in:
parent
0c66363920
commit
9255695af2
@ -5,13 +5,13 @@ from logging import getLogger
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from providers.provider import Provider
|
from ..provider import Provider
|
||||||
from providers.utils import ProviderError
|
from ..utils import ProviderError
|
||||||
from providers.types.collection import Collection
|
from ..types.collection import Collection
|
||||||
from providers.types.movie import Movie
|
from ..types.movie import Movie
|
||||||
from providers.types.show import Show
|
from ..types.show import Show
|
||||||
from providers.types.season import Season
|
from ..types.season import Season
|
||||||
from providers.types.episode import Episode
|
from ..types.episode import Episode
|
||||||
from matcher.cache import cache
|
from matcher.cache import cache
|
||||||
|
|
||||||
logger = getLogger(__name__)
|
logger = getLogger(__name__)
|
||||||
@ -172,7 +172,8 @@ class TheXem(Provider):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
return "TheXem"
|
# Use the base name for id lookup on the matcher.
|
||||||
|
return self._base.name
|
||||||
|
|
||||||
async def get_expected_titles(self) -> list[str]:
|
async def get_expected_titles(self) -> list[str]:
|
||||||
return await self._client.get_expected_titles()
|
return await self._client.get_expected_titles()
|
||||||
|
@ -3,7 +3,6 @@ from aiohttp import ClientSession
|
|||||||
from abc import abstractmethod, abstractproperty
|
from abc import abstractmethod, abstractproperty
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from providers.implementations.thexem import TheXem
|
|
||||||
from providers.utils import ProviderError
|
from providers.utils import ProviderError
|
||||||
|
|
||||||
from .types.show import Show
|
from .types.show import Show
|
||||||
@ -35,6 +34,8 @@ class Provider:
|
|||||||
"No provider configured. You probably forgot to specify an API Key"
|
"No provider configured. You probably forgot to specify an API Key"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from providers.implementations.thexem import TheXem
|
||||||
|
|
||||||
provider = next(iter(providers))
|
provider = next(iter(providers))
|
||||||
return TheXem(client, provider)
|
return TheXem(client, provider)
|
||||||
|
|
||||||
@ -70,7 +71,9 @@ class Provider:
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
async def identify_episode(self, show_id: str, season: Optional[int], episode_nbr: int, absolute: int) -> Episode:
|
async def identify_episode(
|
||||||
|
self, show_id: str, season: Optional[int], episode_nbr: int, absolute: int
|
||||||
|
) -> Episode:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user