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:
co-authored by
Claude Fable 5
parent
3dda666273
commit
7c30928907
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user