Skip to content

fix(assets): preview CRI movies by their exported MP4 - #107

Merged
yonglanws merged 2 commits into
StarMoe-org:mainfrom
yonglanws:fix/asset-usm-video-preview
Nov 9, 2026
Merged

yonglanws merged 2 commits into
StarMoe-org:mainfrom
yonglanws:fix/asset-usm-video-preview

Conversation

@yonglanws

Copy link
Copy Markdown
Contributor

Problem

The asset browser lists CRI movies as .usm files, but getAssetBrowserPreview had no mapping for them, so the file details modal showed no preview and no download link.

The exporter does not publish the .usm itself; it publishes the encoded MP4 nested under the movie's own key:

  • Cri/Video/live/MV/music_mv_001_100001.usm → .../Cri/Video/live/MV/music_mv_001_100001/music_mv_001_100001.mp4
  • Nested story keys keep their extra directory: Cri/Video/live/MV/music_mv_001_100001/music_mv_001_100001.usm → .../music_mv_001_100001/music_mv_001_100001/music_mv_001_100001.mp4

Change

  • Map .usm files under Cri/Video/ to their exported MP4 ({language}/Cri/Video/<key>/<name>.mp4, moved to the browsed region through serverAssetUrl).
  • Add a video player, download and "open original video" to the asset detail modal.
  • Add the openVideo string to the five core locales.
  • Cover the flat and nested mappings in tests/asset-preview.test.ts.

Only Cri/Video is mapped. Member-card USM movies are not exported yet, so they keep showing no preview instead of loading a URL that answers 404.

Checks

  • bun run check
  • bun run lint
  • bun test tests/asset-preview.test.ts (7 pass)

The asset browser lists a CRI movie as a .usm file, but the exporter publishes only its encoded MP4 nested under the movie's own key. Map Cri/Video/<key>.usm to Cri/Video/<key>/<name>.mp4 so the browser can play and download it, keeping nested story keys intact.

Add a video player, download and open link to the file details modal, and cover the flat and nested mappings in the asset preview tests.
The file details modal already offers Download in its quick actions, so the video preview only needs the open-original link.
@yonglanws
yonglanws merged commit 2e830e6 into StarMoe-org:main Nov 9, 2026
2 checks passed
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.

1 participant