mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-09 04:19:27 -07:00
Group sessions for the same video inside each day header so repeated viewings of an episode collapse into a single expandable bucket with aggregate active time and card counts. Multi-session buckets get a dedicated delete action that wipes every session in the group via the bulk delete endpoint; singleton buckets continue to render the existing SessionRow flow unchanged. Delete confirmation copy lives in delete-confirm for parity with the other bulk-delete flows, and the bucket delete path is extracted into a pure buildBucketDeleteHandler factory so it can be unit-tested without rendering the tab. MediaSessionList is intentionally untouched -- it is already scoped to a single video and doesn't need rollup.
26 lines
909 B
TypeScript
26 lines
909 B
TypeScript
export function confirmSessionDelete(): boolean {
|
|
return globalThis.confirm('Delete this session and all associated data?');
|
|
}
|
|
|
|
export function confirmDayGroupDelete(dayLabel: string, count: number): boolean {
|
|
return globalThis.confirm(
|
|
`Delete all ${count} session${count === 1 ? '' : 's'} from ${dayLabel} and all associated data?`,
|
|
);
|
|
}
|
|
|
|
export function confirmAnimeGroupDelete(title: string, count: number): boolean {
|
|
return globalThis.confirm(
|
|
`Delete all ${count} session${count === 1 ? '' : 's'} for "${title}" and all associated data?`,
|
|
);
|
|
}
|
|
|
|
export function confirmEpisodeDelete(title: string): boolean {
|
|
return globalThis.confirm(`Delete "${title}" and all its sessions?`);
|
|
}
|
|
|
|
export function confirmBucketDelete(title: string, count: number): boolean {
|
|
return globalThis.confirm(
|
|
`Delete all ${count} session${count === 1 ? '' : 's'} of "${title}" from this day?`,
|
|
);
|
|
}
|