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