mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user