mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-06 02:59:28 +00:00
refactor: simplify queueAudioBookDownload method by removing callback handling
This commit is contained in:
parent
792448b0ef
commit
5c9273c812
2 changed files with 3 additions and 21 deletions
|
|
@ -50,28 +50,10 @@ class DownloadManager extends _$DownloadManager {
|
|||
}
|
||||
|
||||
Future<void> queueAudioBookDownload(
|
||||
LibraryItemExpanded item, {
|
||||
void Function(TaskStatusUpdate)? taskStatusCallback,
|
||||
void Function(TaskProgressUpdate)? taskProgressCallback,
|
||||
}) async {
|
||||
LibraryItemExpanded item,
|
||||
) async {
|
||||
await state.queueAudioBookDownload(
|
||||
item,
|
||||
taskStatusCallback: (item) {
|
||||
try {
|
||||
taskStatusCallback?.call(item);
|
||||
} catch (e) {
|
||||
_logger.severe('Error in taskStatusCallback', e);
|
||||
}
|
||||
ref.notifyListeners();
|
||||
},
|
||||
taskProgressCallback: (item) {
|
||||
try {
|
||||
taskProgressCallback?.call(item);
|
||||
} catch (e) {
|
||||
_logger.severe('Error in taskProgressCallback', e);
|
||||
}
|
||||
ref.notifyListeners();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ final simpleDownloadManagerProvider = NotifierProvider<SimpleDownloadManager,
|
|||
);
|
||||
|
||||
typedef _$SimpleDownloadManager = Notifier<core.AudiobookDownloadManager>;
|
||||
String _$downloadManagerHash() => r'9566b772d792b32e1b199d4aa834e28de3b034d0';
|
||||
String _$downloadManagerHash() => r'7296a39439230f77abbe7d3231dae748f09c7ecf';
|
||||
|
||||
/// See also [DownloadManager].
|
||||
@ProviderFor(DownloadManager)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue