mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-12 08:16:37 +08:00
Unify organize ingest pipeline
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user