feat(library): remove a track from the library without deleting the file
RemoveFromLibrary deletes the audio_files rows the way the scan's own orphan cleanup does and records each path in excluded_paths. The exclusion is not an enhancement: without it the next scan finds the file, sees no row and imports it again, so the button undoes itself. The soft scan compares files on disk against rows in the database, so surveyAudioFiles and countAudioFiles both take the exclusion set — otherwise an excluded path makes the two disagree forever and queues a full scan on every launch. Deleting a row cascades to queue_tracks, so the removal calls the same CompactQueue hook RemoveLibrary does. Also lands the requested badge: library-status-indicator is a button again where it can act, utils/library-status.ts states once what owning and wanting mean, and the long-declared queued state finally has a producer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDCbcCZQepnpSQYJ6SxxZm
This commit is contained in:
+3
-3
@@ -35,7 +35,7 @@ export function GetArtistImageCachedPath(arg1:string):Promise<string>;
|
||||
|
||||
export function GetArtistImageURL(arg1:string):Promise<string>;
|
||||
|
||||
export function GetArtistImages(arg1:Array<string>):Promise<Record<string, string>>;
|
||||
export function GetArtistImagesCachedPaths(arg1:Array<string>):Promise<Record<string, string>>;
|
||||
|
||||
export function GetArtistMBID(arg1:string):Promise<string>;
|
||||
|
||||
@@ -49,8 +49,6 @@ export function GetIndexStatus():Promise<explore.IndexStatus>;
|
||||
|
||||
export function GetLibrarySimilarArtists(arg1:string):Promise<Array<explore.LBSimilarArtist>>;
|
||||
|
||||
export function GetPopularityBatch(arg1:Array<string>):Promise<Record<string, explore.PersonalizationResult>>;
|
||||
|
||||
export function GetThumbnail(arg1:string,arg2:string,arg3:string):Promise<string>;
|
||||
|
||||
export function GetThumbnails(arg1:Array<explore.ThumbnailRequest>):Promise<Record<string, string>>;
|
||||
@@ -103,6 +101,8 @@ export function SearchLocal(arg1:string):Promise<explore.MBSearchResult>;
|
||||
|
||||
export function SearchLyrics(arg1:string):Promise<Array<explore.LyricsResult>>;
|
||||
|
||||
export function SetAlbumComplete(arg1:explore.AlbumCompleteFunc):Promise<void>;
|
||||
|
||||
export function SetContext(arg1:context.Context):Promise<void>;
|
||||
|
||||
export function SetJobRegistry(arg1:jobs.Registry):Promise<void>;
|
||||
|
||||
@@ -62,8 +62,8 @@ export function GetArtistImageURL(arg1) {
|
||||
return window['go']['explore']['Service']['GetArtistImageURL'](arg1);
|
||||
}
|
||||
|
||||
export function GetArtistImages(arg1) {
|
||||
return window['go']['explore']['Service']['GetArtistImages'](arg1);
|
||||
export function GetArtistImagesCachedPaths(arg1) {
|
||||
return window['go']['explore']['Service']['GetArtistImagesCachedPaths'](arg1);
|
||||
}
|
||||
|
||||
export function GetArtistMBID(arg1) {
|
||||
@@ -90,10 +90,6 @@ export function GetLibrarySimilarArtists(arg1) {
|
||||
return window['go']['explore']['Service']['GetLibrarySimilarArtists'](arg1);
|
||||
}
|
||||
|
||||
export function GetPopularityBatch(arg1) {
|
||||
return window['go']['explore']['Service']['GetPopularityBatch'](arg1);
|
||||
}
|
||||
|
||||
export function GetThumbnail(arg1, arg2, arg3) {
|
||||
return window['go']['explore']['Service']['GetThumbnail'](arg1, arg2, arg3);
|
||||
}
|
||||
@@ -198,6 +194,10 @@ export function SearchLyrics(arg1) {
|
||||
return window['go']['explore']['Service']['SearchLyrics'](arg1);
|
||||
}
|
||||
|
||||
export function SetAlbumComplete(arg1) {
|
||||
return window['go']['explore']['Service']['SetAlbumComplete'](arg1);
|
||||
}
|
||||
|
||||
export function SetContext(arg1) {
|
||||
return window['go']['explore']['Service']['SetContext'](arg1);
|
||||
}
|
||||
|
||||
+2
@@ -73,6 +73,8 @@ export function QueuedLibraryNames():Promise<Array<string>>;
|
||||
|
||||
export function ReleasePipelineLock():Promise<void>;
|
||||
|
||||
export function RemoveFromLibrary(arg1:Array<string>):Promise<library.RemovalResult>;
|
||||
|
||||
export function RemoveLibrary(arg1:number):Promise<library.RemovalSummary>;
|
||||
|
||||
export function RenameLibrary(arg1:number,arg2:string):Promise<void>;
|
||||
|
||||
@@ -138,6 +138,10 @@ export function ReleasePipelineLock() {
|
||||
return window['go']['library']['Library']['ReleasePipelineLock']();
|
||||
}
|
||||
|
||||
export function RemoveFromLibrary(arg1) {
|
||||
return window['go']['library']['Library']['RemoveFromLibrary'](arg1);
|
||||
}
|
||||
|
||||
export function RemoveLibrary(arg1) {
|
||||
return window['go']['library']['Library']['RemoveLibrary'](arg1);
|
||||
}
|
||||
|
||||
@@ -1780,6 +1780,20 @@ export namespace library {
|
||||
this.queueItemCount = source["queueItemCount"];
|
||||
}
|
||||
}
|
||||
export class RemovalResult {
|
||||
tracksRemoved: number;
|
||||
pathsExcluded: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new RemovalResult(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.tracksRemoved = source["tracksRemoved"];
|
||||
this.pathsExcluded = source["pathsExcluded"];
|
||||
}
|
||||
}
|
||||
export class RemovalSummary {
|
||||
tracksDeleted: number;
|
||||
artistsRemoved: number;
|
||||
|
||||
Reference in New Issue
Block a user