Remove obsolete argument

This commit is contained in:
Ming Ming 2022-01-19 13:08:48 +08:00
parent c69692e35b
commit 2dcfe4a261
2 changed files with 5 additions and 20 deletions

View file

@ -15,23 +15,15 @@ class ScanDir {
/// ///
/// Dirs with a .nomedia/.noimage file will be ignored. The returned stream /// Dirs with a .nomedia/.noimage file will be ignored. The returned stream
/// would emit either List<File> or ExceptionEvent /// would emit either List<File> or ExceptionEvent
/// Stream<dynamic> call(Account account, File root) async* {
/// If [isSupportedFileOnly] == true, the returned files will be filtered by
/// [file_util.isSupportedFormat]
Stream<dynamic> call(
Account account,
File root, {
bool isSupportedFileOnly = true,
}) async* {
try { try {
final items = await Ls(fileRepo)(account, root); final items = await Ls(fileRepo)(account, root);
if (_shouldScanIgnoreDir(items)) { if (_shouldScanIgnoreDir(items)) {
return; return;
} }
yield items yield items
.where((f) => .where(
f.isCollection != true && (f) => f.isCollection != true && file_util.isSupportedFormat(f))
(!isSupportedFileOnly || file_util.isSupportedFormat(f)))
.toList(); .toList();
for (final i in items.where((element) => for (final i in items.where((element) =>
element.isCollection == true && element.isCollection == true &&

View file

@ -15,15 +15,8 @@ class ScanDirOffline {
/// List all files under a dir recursively from the local DB /// List all files under a dir recursively from the local DB
/// ///
/// Dirs with a .nomedia/.noimage file will be ignored. /// Dirs with a .nomedia/.noimage file will be ignored
/// Future<List<File>> call(Account account, File root) async {
/// If [isSupportedFileOnly] == true, the returned files will be filtered by
/// [file_util.isSupportedFormat]
Future<List<File>> call(
Account account,
File root, {
bool isSupportedFileOnly = true,
}) async {
final skipDirs = <File>[]; final skipDirs = <File>[];
final files = await _c.appDb.use((db) async { final files = await _c.appDb.use((db) async {
final transaction = db.transaction(AppDb.file2StoreName, idbModeReadOnly); final transaction = db.transaction(AppDb.file2StoreName, idbModeReadOnly);