From c22d8271aeadfcdc2d1c141f5a274dbbd555bb79 Mon Sep 17 00:00:00 2001 From: ShukeBta Date: Thu, 11 Jun 2026 13:21:37 +0800 Subject: [PATCH] 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) --- internal/service/scanner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/scanner.go b/internal/service/scanner.go index 351b8ff..24135fb 100644 --- a/internal/service/scanner.go +++ b/internal/service/scanner.go @@ -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) }