mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Fix runtime issue
This commit is contained in:
parent
b228fbb35c
commit
a346800724
@ -22,13 +22,13 @@ class Status(str, Enum):
|
|||||||
class ShowTranslation:
|
class ShowTranslation:
|
||||||
name: str
|
name: str
|
||||||
tagline: Optional[str] = None
|
tagline: Optional[str] = None
|
||||||
tags: list[str] = []
|
tags: list[str] = field(default_factory=list)
|
||||||
overview: Optional[str] = None
|
overview: Optional[str] = None
|
||||||
|
|
||||||
posters: list[str] = []
|
posters: list[str] = field(default_factory=list)
|
||||||
logos: list[str] = []
|
logos: list[str] = field(default_factory=list)
|
||||||
trailers: list[str] = []
|
trailers: list[str] = field(default_factory=list)
|
||||||
thumbnails: list[str] = []
|
thumbnails: list[str] = field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -3,13 +3,14 @@ from __future__ import annotations
|
|||||||
import os
|
import os
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
from typing import Literal, Any
|
from typing import TYPE_CHECKING, Literal, Any
|
||||||
|
|
||||||
from providers.types.movie import Movie
|
if TYPE_CHECKING:
|
||||||
from providers.types.show import Show
|
from providers.types.movie import Movie
|
||||||
from providers.types.season import Season
|
from providers.types.show import Show
|
||||||
from providers.types.episode import Episode
|
from providers.types.season import Season
|
||||||
from providers.types.collection import Collection
|
from providers.types.episode import Episode
|
||||||
|
from providers.types.collection import Collection
|
||||||
|
|
||||||
type Resource = Movie | Show | Season | Episode | Collection
|
type Resource = Movie | Show | Season | Episode | Collection
|
||||||
|
|
||||||
@ -27,6 +28,9 @@ default_languages = os.environ["LIBRARY_LANGUAGES"].split(",")
|
|||||||
|
|
||||||
|
|
||||||
def select_translation(value: Resource, *, prefer_orginal=False) -> Any:
|
def select_translation(value: Resource, *, prefer_orginal=False) -> Any:
|
||||||
|
from providers.types.movie import Movie
|
||||||
|
from providers.types.show import Show
|
||||||
|
|
||||||
if (
|
if (
|
||||||
prefer_orginal
|
prefer_orginal
|
||||||
and (isinstance(value, Movie) or isinstance(value, Show))
|
and (isinstance(value, Movie) or isinstance(value, Show))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user