Skip to content

Add video_normalized media type option for ScreenScraper scans#3088

Merged
gantoine merged 2 commits intomasterfrom
copilot/add-video-normalized-config
Mar 8, 2026
Merged

Add video_normalized media type option for ScreenScraper scans#3088
gantoine merged 2 commits intomasterfrom
copilot/add-video-normalized-config

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

ScreenScraper exposes both video and video-normalized for each game. Only video was supported, with no way to opt into the normalized variant (~57% smaller in practice).

Changes

  • MetadataMediaType enum — adds VIDEO_NORMALIZED = "video_normalized", making it a valid scan.media config value that passes existing validation
  • SSMetadataMedia TypedDict — adds video_normalized_path field; extraction logic now sets it (and triggers download) when video_normalized is in preferred media types, storing to roms/{platform_id}/{rom_id}/video_normalized/video-normalized.mp4
  • RomSSMetadata TS type — adds video_normalized_path to the generated model
  • FrontendMediaCarousel.vue and useGameAnimation.ts fall back to video_normalized_path when video_path is absent
  • config.example.yml — documents the new option

Usage

scan:
  media:
    - video_normalized  # Normalized video (smaller file size than video)

The existing generic download loop in scan.py ({media_type.value}_url / {media_type.value}_path) picks up the new type with no changes required there.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature] Add video-normalized to config.yml for scan.media (ScreenScraper)</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
ScreenScraper provides both video and normalized video for each game, but the only configuration available is 'video', which has a large file size.

Describe the solution you'd like
A config value for scan.media to set video-normalized, to download video-normalized.mp4 instead of video.mp4

Describe alternatives you've considered
Manual download of video-normalized and replace it with the current video.mp4 file.

Additional context
The difference in file size is significant for a big library:
Image

Easy task, the urls are similar: (ScreenScraper)
medias/57/19295/video.mp4
medias/57/19295/video-normalized.mp4</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add video-normalized to config.yml for scan.media Add video_normalized media type option for ScreenScraper scans Mar 8, 2026
@gantoine gantoine marked this pull request as ready for review March 8, 2026 20:48
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2026

Test Results (postgresql)

942 tests  ±0   941 ✅ ±0   2m 18s ⏱️ -3s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 7f88923. ± Comparison against base commit a977b39.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2026

Test Results (mariadb)

942 tests  ±0   941 ✅ ±0   2m 10s ⏱️ -5s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 7f88923. ± Comparison against base commit a977b39.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
13806 9259 67% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/config/config_manager.py 55% 🟢
backend/handler/metadata/ss_handler.py 32% 🟢
TOTAL 43% 🟢

updated for commit: 7f88923 by action🐍

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR adds video_normalized as a valid scan.media config option for ScreenScraper scans, allowing users to opt into the smaller normalized video variant (~57% smaller). The implementation follows the existing patterns closely: a new MetadataMediaType.VIDEO_NORMALIZED enum value drives the extraction logic in ss_handler.py, the generic {media_type.value}_url/{media_type.value}_path download loop in scan.py and roms/__init__.py picks it up with no changes required, and both frontend components fall back to video_normalized_path when video_path is absent.

  • VIDEO_NORMALIZED = "video_normalized" added cleanly to MetadataMediaType enum.
  • SSMetadataMedia TypedDict gains video_normalized_path; the URL field video_normalized_url was pre-existing, so the key-name contract with the generic download loop is satisfied out of the box.
  • RomSSMetadata TS type updated consistently with the backend TypedDict.
  • Frontend fallback order is correct: video takes priority when configured, with video_normalized as a proper fallback, which aligns with the feature's intended usage as an alternative option.
  • No database migration required since ss_metadata is stored as an untyped JSON blob.

Confidence Score: 5/5

  • Safe to merge — all changes are additive, follow existing patterns exactly, and carry no breaking risk.
  • This PR is a straightforward extension of the existing media type pattern with correct implementation across backend and frontend. The new VIDEO_NORMALIZED enum value integrates cleanly with the existing generic download loop, the TypedDict is updated consistently, and the frontend fallback logic correctly implements the feature as an alternative option. All files were verified and no bugs or structural issues were found.
  • No files require special attention.

Last reviewed commit: 7f88923

@gantoine gantoine merged commit 9dd155a into master Mar 8, 2026
12 checks passed
@gantoine gantoine deleted the copilot/add-video-normalized-config branch March 8, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add video-normalized to config.yml for scan.media (ScreenScraper)

2 participants