- add image normalization profiles and thumbnail profiles - generate source, full-size variant, and thumbnail image artifacts - rewrite canonical image URLs through the first configured profile - emit explicit image Media RSS groups with named thumbnails - preserve legacy image paths when image conversion is disabled - cover cache-hit source paths, inline image handling, and thumbnail export
73 lines
1.5 KiB
Python
73 lines
1.5 KiB
Python
from dataclasses import dataclass, field
|
|
from typing import Any, List, TypedDict
|
|
|
|
|
|
class MediaVariant(TypedDict, total=False):
|
|
url: str
|
|
path: str
|
|
type: str
|
|
medium: str
|
|
isDefault: str
|
|
fileSize: int | str
|
|
bitrate: int | float | str
|
|
samplingrate: int | str
|
|
channels: int | str
|
|
duration: str
|
|
width: int | str
|
|
height: int | str
|
|
framerate: str
|
|
expression: str
|
|
lang: str
|
|
|
|
|
|
class TranscodedMediaFile(TypedDict):
|
|
url: str
|
|
path: str
|
|
checksum: str | None
|
|
status: str
|
|
published_url: str
|
|
variants: List[MediaVariant]
|
|
|
|
|
|
class ThumbnailVariant(TypedDict, total=False):
|
|
url: str
|
|
path: str
|
|
width: int | str
|
|
height: int | str
|
|
slot: str
|
|
type: str
|
|
|
|
|
|
class TranscodedImageFile(TypedDict):
|
|
url: str
|
|
path: str
|
|
checksum: str | None
|
|
status: str
|
|
published_url: str
|
|
source_path: str
|
|
variants: List[MediaVariant]
|
|
thumbnails: List[ThumbnailVariant]
|
|
|
|
|
|
@dataclass
|
|
class ElementItem:
|
|
feed_name: str
|
|
el: Any
|
|
image_urls: List[str]
|
|
images: List[TranscodedImageFile]
|
|
file_urls: List[str]
|
|
files: List[Any]
|
|
audio_urls: List[str]
|
|
audios: List[TranscodedMediaFile]
|
|
video_urls: List[str]
|
|
videos: List[TranscodedMediaFile]
|
|
media_image_urls: List[str] = field(default_factory=list)
|
|
|
|
|
|
@dataclass
|
|
class ChannelElementItem:
|
|
feed_name: str
|
|
el: Any
|
|
image_urls: List[str]
|
|
images: List[TranscodedImageFile]
|
|
media_image_urls: List[str] = field(default_factory=list)
|