modify metadataproviders to support movies

This commit is contained in:
maxDorninger
2025-06-22 20:59:58 +02:00
parent 6784a800cf
commit 5a8d3b1ef9
4 changed files with 225 additions and 16 deletions

View File

@@ -2,8 +2,9 @@ import logging
from abc import ABC, abstractmethod
import media_manager.config
from media_manager.metadataProvider.schemas import MetaDataProviderShowSearchResult
from media_manager.metadataProvider.schemas import MetaDataProviderSearchResult
from media_manager.tv.schemas import Show
from media_manager.movies.schemas import Movie
log = logging.getLogger(__name__)
@@ -20,10 +21,21 @@ class AbstractMetadataProvider(ABC):
def get_show_metadata(self, id: int = None) -> Show:
raise NotImplementedError()
@abstractmethod
def get_movie_metadata(self, id: int = None) -> Movie:
raise NotImplementedError()
@abstractmethod
def search_show(
self, query: str | None = None
) -> list[MetaDataProviderShowSearchResult]:
) -> list[MetaDataProviderSearchResult]:
raise NotImplementedError()
@abstractmethod
def search_movie(
self, query: str | None = None
) -> list[MetaDataProviderSearchResult]:
raise NotImplementedError()
@abstractmethod
@@ -35,6 +47,14 @@ class AbstractMetadataProvider(ABC):
"""
raise NotImplementedError()
@abstractmethod
def download_movie_poster_image(self, show: Show) -> bool:
"""
Downloads the poster image for a show.
:param show: The show to download the poster image for.
:return: True if the image was downloaded successfully, False otherwise.
"""
raise NotImplementedError()
metadata_providers = {}