fix: remove deleted local library item from provider state after file deletion

When deleting a non-CUE local library track from the metadata screen,
only the file was removed but the library database entry and provider
state were left untouched, causing the track to persist in the library UI.
Now calls removeItem() on localLibraryProvider after deleteFile().
This commit is contained in:
zarzet
2026-04-01 21:04:42 +07:00
parent d034144e9c
commit 65dbd5c8e4
4 changed files with 22 additions and 4 deletions
+5
View File
@@ -3851,6 +3851,11 @@ class _TrackMetadataScreenState extends ConsumerState<TrackMetadataScreen> {
} catch (e) {
debugPrint('Failed to delete file: $e');
}
if (_localLibraryItem != null) {
await ref
.read(localLibraryProvider.notifier)
.removeItem(_localLibraryItem!.id);
}
}
} else {
try {