Fix runtime issue

This commit is contained in:
Zoe Roux 2024-05-14 02:31:19 +02:00
parent b228fbb35c
commit a346800724
No known key found for this signature in database
2 changed files with 15 additions and 11 deletions

View File

@ -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

View File

@ -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))