fix(frontend): reposition search indicator into toolbar and fix album cover art lookup
Move search indicator from absolute-positioned overlay into sort toolbar (or dedicated search-bar-row for artists/genres views). Shows indicator on empty-state screens. Fix cover art not displaying for expanded album tracks by checking expandedAlbumId before the albumName guard. Add ScanWarning model bindings.
This commit is contained in:
@@ -66,6 +66,22 @@ export namespace library {
|
||||
|
||||
}
|
||||
}
|
||||
export class ScanWarning {
|
||||
filePath: string;
|
||||
phase: string;
|
||||
err: any;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new ScanWarning(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.filePath = source["filePath"];
|
||||
this.phase = source["phase"];
|
||||
this.err = source["err"];
|
||||
}
|
||||
}
|
||||
export class ScanMetrics {
|
||||
total: number;
|
||||
loadExisting: number;
|
||||
@@ -92,6 +108,7 @@ export namespace library {
|
||||
updated: number;
|
||||
skipped: number;
|
||||
removed: number;
|
||||
warnings: ScanWarning[];
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new ScanMetrics(source);
|
||||
@@ -124,8 +141,28 @@ export namespace library {
|
||||
this.updated = source["updated"];
|
||||
this.skipped = source["skipped"];
|
||||
this.removed = source["removed"];
|
||||
this.warnings = this.convertValues(source["warnings"], ScanWarning);
|
||||
}
|
||||
|
||||
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 class Track {
|
||||
TrackName: string;
|
||||
ArtistName: string;
|
||||
|
||||
Reference in New Issue
Block a user