feat(web): series, season and episode removal

Series detail exposes DELETE /api/series/{id} through the movie
removePanel, generalised over endpoints and file rollup instead of
copied. Season headers and on-disk episode rows get the settings
armed-delete control wired to #174's file endpoints, worded for what
they do: files go, wanted clears, the row stays listed.

Closes #175

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-24 17:09:46 +01:00
co-authored by Claude Fable 5
parent 3dda666273
commit 7c30928907
6 changed files with 275 additions and 27 deletions
+2 -2
View File
@@ -131,7 +131,7 @@ export async function movieFiles(movieId: number): Promise<FilesOutcome> {
* names everything a files-too remove takes. `null` when the files disagree,
* which the panel then says instead of naming one folder falsely.
*/
export function libraryFolder(files: MovieFile[]): string | null {
export function libraryFolder(files: { path: string }[]): string | null {
const folders = new Set(files.map((file) => file.path.slice(0, file.path.lastIndexOf("/"))));
if (folders.size !== 1) {
return null;
@@ -140,7 +140,7 @@ export function libraryFolder(files: MovieFile[]): string | null {
return folder === undefined || folder === "" ? null : folder;
}
export function totalSize(files: MovieFile[]): number {
export function totalSize(files: { size: number }[]): number {
return files.reduce((sum, file) => sum + file.size, 0);
}