fix file by id in the parent field

This commit is contained in:
2025-11-11 23:53:49 +11:00
parent 5b2090c102
commit 7308e3c97c
6 changed files with 60 additions and 3 deletions

View File

@@ -214,6 +214,20 @@ export class LibraryService {
return this.database.listFiles();
}
/**
* Attempts to resolve a file summary by id. Returns null when the record no longer exists.
*/
public getFileById(fileId: number): AudioFileSummary | null {
try {
return this.database.getFileById(fileId);
} catch (error) {
if (error instanceof Error) {
console.warn(`Failed to resolve file by id ${fileId}:`, error.message);
}
return null;
}
}
/**
* Returns groups of files that have identical checksums (potential duplicates).
*/