mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 06:52:18 +02:00
16 lines
686 B
Dart
16 lines
686 B
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:spotiflac_android/providers/download_history_provider.dart';
|
|
import 'package:spotiflac_android/providers/local_library_provider.dart';
|
|
|
|
/// Call only after deletion succeeds. A download can also have a scanned row;
|
|
/// removing just one index makes its other row visible as a ghost entry.
|
|
Future<void> removeDeletedLibraryFileEntries(
|
|
WidgetRef ref,
|
|
Iterable<String> filePaths,
|
|
) async {
|
|
final paths = filePaths.toSet();
|
|
if (paths.isEmpty) return;
|
|
await ref.read(downloadHistoryProvider.notifier).removePhysicalFiles(paths);
|
|
await ref.read(localLibraryProvider.notifier).removePhysicalFiles(paths);
|
|
}
|