mirror of
https://github.com/rommapp/romm.git
synced 2026-12-02 10:08:40 +01:00
fix(v2): keep media out of the streaming player's disc surfaces
A set with no .cue files listed every rom file as a swap target, so an uploaded manual could be offered as a disc, and the manual-swap hint counted media toward the multi-disc check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,7 @@ import { useSocketEvent } from "@/v2/composables/useSocketEvent";
|
||||
import { useUnloadGuard } from "@/v2/composables/useUnloadGuard";
|
||||
import type { SliderBtnGroupItem } from "@/v2/lib/primitives/RSliderBtnGroup/types";
|
||||
import storeGalleryRoms from "@/v2/stores/galleryRoms";
|
||||
import { bootableFiles } from "@/v2/utils/playerDisc";
|
||||
|
||||
type PlayerState = "idle" | "loading" | "playing" | "error" | "exited";
|
||||
type ErrorType =
|
||||
@@ -248,11 +249,13 @@ const hasM3uFile = computed(() =>
|
||||
(rom.value?.files ?? []).some((f) => fileExtension(f.file_name) === "m3u"),
|
||||
);
|
||||
|
||||
const bootableRomFiles = computed(() => bootableFiles(rom.value?.files ?? []));
|
||||
|
||||
// Mirrors the download endpoint's playlist filtering: when .cue files are
|
||||
// present only those are valid swap targets (raw .bin tracks are not), and
|
||||
// the .m3u itself is never something to swap to.
|
||||
const discOptions = computed(() => {
|
||||
const files = (rom.value?.files ?? []).filter(
|
||||
const files = bootableRomFiles.value.filter(
|
||||
(f) => fileExtension(f.file_name) !== "m3u",
|
||||
);
|
||||
const cueFiles = files.filter((f) => fileExtension(f.file_name) === "cue");
|
||||
@@ -275,7 +278,7 @@ const canSwapDisc = computed(
|
||||
const showManualDiscHint = computed(
|
||||
() =>
|
||||
capabilities.value.hasManualDiscSwap &&
|
||||
(rom.value?.files?.length ?? 0) > 1 &&
|
||||
bootableRomFiles.value.length > 1 &&
|
||||
!isJoining,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user