fix(library): retain records when deletion fails

This commit is contained in:
zarzet
2026-07-27 14:24:39 +07:00
parent 73846c40ca
commit 1cdf4b4547
7 changed files with 94 additions and 40 deletions
+3 -4
View File
@@ -476,10 +476,9 @@ extension _QueueTabSelectionActions on _QueueTabState {
for (final id in _selectedIds) {
final item = itemsById[id];
if (item != null) {
try {
final cleanPath = _cleanFilePath(item.filePath);
await deleteFile(cleanPath);
} catch (_) {}
final cleanPath = _cleanFilePath(item.filePath);
final fileDeleted = await deleteFile(cleanPath);
if (!fileDeleted) continue;
if (item.source == LibraryItemSource.downloaded) {
historyNotifier.removeFromHistory(item.historyItem!.id);