refactored full rescan to use hook/lifecycle pattern and added rescan package
This commit is contained in:
+1
-3
@@ -19,6 +19,4 @@ export function Scan():Promise<library.ScanMetrics>;
|
||||
|
||||
export function SetContext(arg1:context.Context):Promise<void>;
|
||||
|
||||
export function SetPlaylistRestorer(arg1:library.playlistRestorer):Promise<void>;
|
||||
|
||||
export function SetQueue(arg1:library.queueClearer):Promise<void>;
|
||||
export function SetRescanHooks(arg1:library.RescanHooks):Promise<void>;
|
||||
|
||||
@@ -34,10 +34,6 @@ export function SetContext(arg1) {
|
||||
return window['go']['library']['Library']['SetContext'](arg1);
|
||||
}
|
||||
|
||||
export function SetPlaylistRestorer(arg1) {
|
||||
return window['go']['library']['Library']['SetPlaylistRestorer'](arg1);
|
||||
}
|
||||
|
||||
export function SetQueue(arg1) {
|
||||
return window['go']['library']['Library']['SetQueue'](arg1);
|
||||
export function SetRescanHooks(arg1) {
|
||||
return window['go']['library']['Library']['SetRescanHooks'](arg1);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,18 @@ export namespace library {
|
||||
this.Name = source["Name"];
|
||||
}
|
||||
}
|
||||
export class RescanHooks {
|
||||
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new RescanHooks(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
|
||||
}
|
||||
}
|
||||
export class ScanMetrics {
|
||||
total: number;
|
||||
loadExisting: number;
|
||||
|
||||
Reference in New Issue
Block a user