fix: use Get instead of FindByID to lookup storage config by type

The scanner was incorrectly using FindByID(mount.Provider) where mount.Provider
is a type string like 'openlist', not a database ID. This caused all cloud
library scans to fail with 'storage config not found'.

Changed to use Get(ctx, mount.Provider) which correctly looks up by type field.

Fixes cloud library scanning for all providers (openlist/quark/115/clouddrive2)
This commit is contained in:
ShukeBta
2026-06-11 13:21:37 +08:00
parent 66a75e61b4
commit c22d8271ae
+1 -1
View File
@@ -699,7 +699,7 @@ func (s *ScannerService) scanCloudLibrary(ctx context.Context, lib *model.Librar
}
// 验证存储配置是否存在且已启用
cfg, err := s.repo.StorageConfig.FindByID(ctx, mount.Provider)
cfg, err := s.repo.StorageConfig.Get(ctx, mount.Provider)
if err != nil || cfg == nil {
return res, fmt.Errorf("storage config not found: %s", mount.Provider)
}