Always save clips for vods

This commit is contained in:
Kalle
2026-09-25 07:31:23 +03:00
parent d92debd8f9
commit 59cade0e31
4 changed files with 5 additions and 37 deletions

View File

@@ -88,20 +88,6 @@
display: none;
}
.checkbox {
display: flex;
align-items: center;
gap: var(--s-2);
font-size: var(--font-xs);
cursor: pointer;
& input {
width: var(--selector-size-sm);
height: var(--selector-size-sm);
margin: 0;
}
}
.sessions {
display: flex;
flex-direction: column;

View File

@@ -56,7 +56,6 @@ export function LandingView() {
const clips = useClips();
const [telemetry] = useSearchParam(scannerSearchParams, "telemetry");
const [, setParams] = useSearchParamsTyped(scannerSearchParams);
const [saveClipsFromFile, setSaveClipsFromFile] = useState(false);
const [over, setOver] = useState(false);
const [playing, setPlaying] = useState<ScannerClip | null>(null);
@@ -78,7 +77,7 @@ export function LandingView() {
void inspectScreenshot(file);
return;
}
void startVodScan(file, { saveClips: saveClipsFromFile, telemetry });
void startVodScan(file, { telemetry });
setParams({ view: "vod", name: file.name });
};
@@ -162,14 +161,6 @@ export function LandingView() {
}}
/>
</label>
<label className={styles.checkbox}>
<input
type="checkbox"
checked={saveClipsFromFile}
onChange={(e) => setSaveClipsFromFile(e.target.checked)}
/>
Save clips from this VoD
</label>
</section>
</div>

View File

@@ -88,10 +88,7 @@ function ScanVodView({ name }: { name: string }) {
const file = e.target.files?.[0];
e.target.value = "";
if (file) {
void startVodScan(file, {
saveClips: scan.saveClips,
telemetry: telemetryOn,
});
void startVodScan(file, { telemetry: telemetryOn });
}
}}
/>
@@ -115,10 +112,7 @@ function ScanVodView({ name }: { name: string }) {
<div className={styles.previewRow}>
<canvas ref={setVodPreviewCanvas} className={styles.preview} />
<div className={styles.previewNotes}>
<div>
Save clips {scan.saveClips ? "on" : "off"} · Upload{" "}
{user && settings.upload ? "on" : "off"}
</div>
<div>Upload {user && settings.upload ? "on" : "off"}</div>
{scan.error ? (
<div className={styles.error}>{scan.error}</div>
) : null}

View File

@@ -81,7 +81,6 @@ export interface VodScanSnapshot {
progress: VodScanProgress | null;
/** what the scan found, chronological; reloaded from the store once saved */
events: ScanEvent[];
saveClips: boolean;
clipsWork: ClipsWork | null;
telemetry: ScanTelemetry | null;
/** matches uploading right after the scan */
@@ -94,7 +93,6 @@ const IDLE: VodScanSnapshot = {
error: null,
progress: null,
events: [],
saveClips: false,
clipsWork: null,
telemetry: null,
uploading: false,
@@ -180,7 +178,7 @@ export async function uploadVodScan(
/** Scans `file` as fast as decoding allows; a finished scan replaces any saved one of the same name. */
export async function startVodScan(
file: File,
{ saveClips, telemetry }: { saveClips: boolean; telemetry: boolean },
{ telemetry }: { telemetry: boolean },
): Promise<void> {
cancelVodScan();
const abort = { aborted: false };
@@ -197,7 +195,6 @@ export async function startVodScan(
...IDLE,
name: file.name,
status: "scanning",
saveClips,
});
const timeline = new TimelineBuilder();
@@ -424,7 +421,7 @@ export async function startVodScan(
events = (await loadVodEvents(file.name)).map(toScanEvent);
update({ events, status: "done" });
void refreshVods();
if (saveClips) await cutClips(file, events, update);
await cutClips(file, events, update);
if (uploadEnabled()) await uploadVodScan();
}
}