Fix server side metadata service not filtering file type

This commit is contained in:
Ming Ming 2024-11-23 00:44:58 +08:00
parent c1915b393a
commit 15eb565eac
2 changed files with 9 additions and 2 deletions

View file

@ -41,7 +41,7 @@ class _SyncByServer {
_log.fine("[_syncDir] Syncing dir $dir"); _log.fine("[_syncDir] Syncing dir $dir");
final files = await fileRepoRemote.list(account, dir); final files = await fileRepoRemote.list(account, dir);
await FileSqliteCacheUpdater(db)(account, dir, remote: files); await FileSqliteCacheUpdater(db)(account, dir, remote: files);
for (final f in files) { for (final f in files.where((e) => fileIds.contains(e.fdId))) {
File? result; File? result;
if (!_supportedMimes.contains(f.fdMime)) { if (!_supportedMimes.contains(f.fdMime)) {
_log.info( _log.info(

View file

@ -98,8 +98,15 @@ class SyncMetadata {
fallback: fallback, fallback: fallback,
); );
await op.init(); await op.init();
final fileIds = <int>[];
final relativePaths = <String>[];
for (final f in files.items) {
fileIds.add(f.fileId);
relativePaths.add(f.relativePath);
}
final stream = op.syncFiles( final stream = op.syncFiles(
relativePaths: files.items.map((e) => e.relativePath).toList(), fileIds: fileIds,
relativePaths: relativePaths,
); );
yield* stream; yield* stream;
} }