Unify organize ingest pipeline

This commit is contained in:
ShukeBta
2026-06-14 23:17:52 +08:00
parent a623702276
commit 479a06f008
41 changed files with 3075 additions and 728 deletions
+7
View File
@@ -66,6 +66,13 @@ func (s *DownloadClientService) Create(ctx context.Context, in DownloadClientInp
IsDefault: normalized.IsDefault,
Enabled: normalized.Enabled,
}
if !c.IsDefault && c.Enabled {
if currentDefault, err := s.repo.DownloadClient.FindDefault(ctx); err == nil && currentDefault == nil {
if enabled, err := s.repo.DownloadClient.ListEnabled(ctx); err == nil && len(enabled) == 0 {
c.IsDefault = true
}
}
}
if normalized.IsDefault {
_ = s.repo.DownloadClient.ClearDefault(ctx)
}