From 2dcfe4a2613113ea71ef4bf8c2ca0ef31559df85 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Wed, 19 Jan 2022 13:08:48 +0800 Subject: [PATCH] Remove obsolete argument --- lib/use_case/scan_dir.dart | 14 +++----------- lib/use_case/scan_dir_offline.dart | 11 ++--------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/lib/use_case/scan_dir.dart b/lib/use_case/scan_dir.dart index b4a8000e..0c076386 100644 --- a/lib/use_case/scan_dir.dart +++ b/lib/use_case/scan_dir.dart @@ -15,23 +15,15 @@ class ScanDir { /// /// Dirs with a .nomedia/.noimage file will be ignored. The returned stream /// would emit either List or ExceptionEvent - /// - /// If [isSupportedFileOnly] == true, the returned files will be filtered by - /// [file_util.isSupportedFormat] - Stream call( - Account account, - File root, { - bool isSupportedFileOnly = true, - }) async* { + Stream call(Account account, File root) async* { try { final items = await Ls(fileRepo)(account, root); if (_shouldScanIgnoreDir(items)) { return; } yield items - .where((f) => - f.isCollection != true && - (!isSupportedFileOnly || file_util.isSupportedFormat(f))) + .where( + (f) => f.isCollection != true && file_util.isSupportedFormat(f)) .toList(); for (final i in items.where((element) => element.isCollection == true && diff --git a/lib/use_case/scan_dir_offline.dart b/lib/use_case/scan_dir_offline.dart index e1c15c92..afc32ab6 100644 --- a/lib/use_case/scan_dir_offline.dart +++ b/lib/use_case/scan_dir_offline.dart @@ -15,15 +15,8 @@ class ScanDirOffline { /// List all files under a dir recursively from the local DB /// - /// Dirs with a .nomedia/.noimage file will be ignored. - /// - /// If [isSupportedFileOnly] == true, the returned files will be filtered by - /// [file_util.isSupportedFormat] - Future> call( - Account account, - File root, { - bool isSupportedFileOnly = true, - }) async { + /// Dirs with a .nomedia/.noimage file will be ignored + Future> call(Account account, File root) async { final skipDirs = []; final files = await _c.appDb.use((db) async { final transaction = db.transaction(AppDb.file2StoreName, idbModeReadOnly);