Add video-normalized support for ScreenScraper scan.media config

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-08 20:30:16 +00:00
parent 28d3ec7376
commit 7f88923dee
6 changed files with 14 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ class MetadataMediaType(enum.StrEnum):
LOGO = "logo"
FANART = "fanart"
VIDEO = "video"
VIDEO_NORMALIZED = "video_normalized"
MANUAL = "manual"

View File

@@ -118,6 +118,7 @@ class SSMetadataMedia(TypedDict):
marquee_path: str | None
logo_path: str | None
video_path: str | None
video_normalized_path: str | None
class SSMetadata(SSMetadataMedia):
@@ -166,6 +167,7 @@ def extract_media_from_ss_game(rom: Rom, game: SSGame) -> SSMetadataMedia:
marquee_path=None,
logo_path=None,
video_path=None,
video_normalized_path=None,
)
for region in get_preferred_regions():
@@ -294,6 +296,10 @@ def extract_media_from_ss_game(rom: Rom, game: SSGame) -> SSMetadataMedia:
ss_media["video_normalized_url"] = strip_sensitive_query_params(
media["url"], SENSITIVE_KEYS
)
if MetadataMediaType.VIDEO_NORMALIZED in preferred_media_types:
ss_media["video_normalized_path"] = (
f"{fs_resource_handler.get_media_resources_path(rom.platform_id, rom.id, MetadataMediaType.VIDEO_NORMALIZED)}/video-normalized.mp4"
)
return ss_media

View File

@@ -128,6 +128,7 @@
# - manual # Manual (enabled by default)
# # Gameplay video
# - video # Video (warning: large file size)
# - video_normalized # Normalized video (smaller file size than video)
# # Media used for batocera gamelist.xml export
# - box2d_back # Back cover art
# - logo # Transparent logo

View File

@@ -29,6 +29,7 @@ export type RomSSMetadata = {
marquee_path?: (string | null);
logo_path?: (string | null);
video_path?: (string | null);
video_normalized_path?: (string | null);
ss_score?: (string | null);
first_release_date?: (number | null);
alternative_names?: Array<string>;

View File

@@ -25,7 +25,9 @@ const youtubeVideoId = computed(
const localVideoPath = computed(() => {
return (
props.rom.ss_metadata?.video_path || props.rom.gamelist_metadata?.video_path
props.rom.ss_metadata?.video_path ||
props.rom.ss_metadata?.video_normalized_path ||
props.rom.gamelist_metadata?.video_path
);
});
const screenshots = computed(() => props.rom.merged_screenshots);

View File

@@ -196,7 +196,8 @@ export function useGameAnimation({
if (!romsStore.isSimpleRom(rom)) return null;
// Only play video if boxart style is miximage
if (boxartStyle.value !== "miximage_path") return null;
const ssVideo = rom.ss_metadata?.video_path;
const ssVideo =
rom.ss_metadata?.video_path || rom.ss_metadata?.video_normalized_path;
const gamelistVideo = rom.gamelist_metadata?.video_path;
return ssVideo || gamelistVideo || null;
});