fix(12-02): reorder orphan cleanup to delete FK children before recordings

recording_genres and release_group_recordings reference recordings.id,
so they must be deleted BEFORE the recordings table is cleaned.
Also extends toast duration to 8s for readability.
This commit is contained in:
2026-03-13 13:38:39 -04:00
parent cf004986c9
commit 1d735c3a5f
7 changed files with 119 additions and 55 deletions
+68 -14
View File
@@ -40,6 +40,20 @@ export namespace library {
this.Name = source["Name"];
}
}
export class GenreWithCount {
Name: string;
TrackCount: number;
static createFrom(source: any = {}) {
return new GenreWithCount(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.Name = source["Name"];
this.TrackCount = source["TrackCount"];
}
}
export class Info {
id: number;
name: string;
@@ -58,6 +72,18 @@ export namespace library {
this.trackCount = source["trackCount"];
}
}
export class RemovalHooks {
static createFrom(source: any = {}) {
return new RemovalHooks(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
}
}
export class RemovalImpact {
trackCount: number;
playlistsAffected: number;
@@ -96,20 +122,6 @@ export namespace library {
this.queueItemsRemoved = source["queueItemsRemoved"];
}
}
export class GenreWithCount {
Name: string;
TrackCount: number;
static createFrom(source: any = {}) {
return new GenreWithCount(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.Name = source["Name"];
this.TrackCount = source["TrackCount"];
}
}
export class RescanHooks {
@@ -606,6 +618,48 @@ export namespace queue {
}
export namespace sqlcgen {
export class Library {
ID: number;
Name: string;
Path: string;
// Go type: time
CreatedAt: any;
static createFrom(source: any = {}) {
return new Library(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.Name = source["Name"];
this.Path = source["Path"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}
export namespace tracklist {
export class Column {