mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-18 03:54:03 +02:00
modify metadataproviders to support movies
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
from uuid import UUID
|
||||
|
||||
from PIL import Image
|
||||
import requests
|
||||
import pillow_avif
|
||||
|
||||
pillow_avif
|
||||
|
||||
def get_year_from_first_air_date(first_air_date: str | None) -> int | None:
|
||||
def get_year_from_date(first_air_date: str | None) -> int | None:
|
||||
if first_air_date:
|
||||
return int(first_air_date.split("-")[0])
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def download_poster_image(storage_path=None, poster_url=None, show=None) -> bool:
|
||||
def download_poster_image(storage_path=None, poster_url=None, id: UUID=None) -> bool:
|
||||
res = requests.get(poster_url, stream=True)
|
||||
if res.status_code == 200:
|
||||
image_file_path = storage_path.joinpath(str(show.id))
|
||||
image_file_path = storage_path.joinpath(str(id))
|
||||
with open(str(image_file_path) + ".jpg", "wb") as f:
|
||||
f.write(res.content)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user