@@ -32,42 +32,32 @@ type automationSettingsRequest struct {
3232 Enabled bool `json:"enabled"`
3333 RunIntervalMinutes int `json:"runIntervalMinutes"`
3434 StartPaused bool `json:"startPaused"`
35- Category * string `json:"category"`
36- IgnorePatterns []string `json:"ignorePatterns"`
37- TargetInstanceIDs []int `json:"targetInstanceIds"`
38- TargetIndexerIDs []int `json:"targetIndexerIds"`
39- MaxResultsPerRun int `json:"maxResultsPerRun"` // Deprecated: automation now processes full feeds and ignores this value
40- FindIndividualEpisodes bool `json:"findIndividualEpisodes"`
41- SizeMismatchTolerancePercent float64 `json:"sizeMismatchTolerancePercent"`
42- UseCategoryFromIndexer bool `json:"useCategoryFromIndexer"`
43- UseCrossCategorySuffix bool `json:"useCrossCategorySuffix"`
44- RunExternalProgramID * int `json:"runExternalProgramId"`
45- Completion * completionSettingsRequest `json:"completion"`
46- }
47-
48- type completionSettingsRequest struct {
49- Enabled bool `json:"enabled"`
50- Categories []string `json:"categories"`
51- Tags []string `json:"tags"`
52- ExcludeCategories []string `json:"excludeCategories"`
53- ExcludeTags []string `json:"excludeTags"`
35+ Category * string `json:"category"`
36+ IgnorePatterns []string `json:"ignorePatterns"`
37+ TargetInstanceIDs []int `json:"targetInstanceIds"`
38+ TargetIndexerIDs []int `json:"targetIndexerIds"`
39+ MaxResultsPerRun int `json:"maxResultsPerRun"` // Deprecated: automation now processes full feeds and ignores this value
40+ FindIndividualEpisodes bool `json:"findIndividualEpisodes"`
41+ SizeMismatchTolerancePercent float64 `json:"sizeMismatchTolerancePercent"`
42+ UseCategoryFromIndexer bool `json:"useCategoryFromIndexer"`
43+ UseCrossCategorySuffix bool `json:"useCrossCategorySuffix"`
44+ RunExternalProgramID * int `json:"runExternalProgramId"`
5445}
5546
5647type automationSettingsPatchRequest struct {
57- Enabled * bool `json:"enabled,omitempty"`
58- RunIntervalMinutes * int `json:"runIntervalMinutes,omitempty"`
59- StartPaused * bool `json:"startPaused,omitempty"`
60- Category optionalString `json:"category"`
61- IgnorePatterns * []string `json:"ignorePatterns,omitempty"`
62- TargetInstanceIDs * []int `json:"targetInstanceIds,omitempty"`
63- TargetIndexerIDs * []int `json:"targetIndexerIds,omitempty"`
64- MaxResultsPerRun * int `json:"maxResultsPerRun,omitempty"` // Deprecated: automation now processes full feeds and ignores this value
65- FindIndividualEpisodes * bool `json:"findIndividualEpisodes,omitempty"`
66- SizeMismatchTolerancePercent * float64 `json:"sizeMismatchTolerancePercent,omitempty"`
67- UseCategoryFromIndexer * bool `json:"useCategoryFromIndexer,omitempty"`
68- UseCrossCategorySuffix * bool `json:"useCrossCategorySuffix,omitempty"`
69- RunExternalProgramID optionalInt `json:"runExternalProgramId"`
70- Completion * completionSettingsPatchRequest `json:"completion,omitempty"`
48+ Enabled * bool `json:"enabled,omitempty"`
49+ RunIntervalMinutes * int `json:"runIntervalMinutes,omitempty"`
50+ StartPaused * bool `json:"startPaused,omitempty"`
51+ Category optionalString `json:"category"`
52+ IgnorePatterns * []string `json:"ignorePatterns,omitempty"`
53+ TargetInstanceIDs * []int `json:"targetInstanceIds,omitempty"`
54+ TargetIndexerIDs * []int `json:"targetIndexerIds,omitempty"`
55+ MaxResultsPerRun * int `json:"maxResultsPerRun,omitempty"` // Deprecated: automation now processes full feeds and ignores this value
56+ FindIndividualEpisodes * bool `json:"findIndividualEpisodes,omitempty"`
57+ SizeMismatchTolerancePercent * float64 `json:"sizeMismatchTolerancePercent,omitempty"`
58+ UseCategoryFromIndexer * bool `json:"useCategoryFromIndexer,omitempty"`
59+ UseCrossCategorySuffix * bool `json:"useCrossCategorySuffix,omitempty"`
60+ RunExternalProgramID optionalInt `json:"runExternalProgramId"`
7161 // Source-specific tagging
7262 RSSAutomationTags * []string `json:"rssAutomationTags,omitempty"`
7363 SeededSearchTags * []string `json:"seededSearchTags,omitempty"`
@@ -76,14 +66,6 @@ type automationSettingsPatchRequest struct {
7666 InheritSourceTags * bool `json:"inheritSourceTags,omitempty"`
7767}
7868
79- type completionSettingsPatchRequest struct {
80- Enabled * bool `json:"enabled,omitempty"`
81- Categories * []string `json:"categories,omitempty"`
82- Tags * []string `json:"tags,omitempty"`
83- ExcludeCategories * []string `json:"excludeCategories,omitempty"`
84- ExcludeTags * []string `json:"excludeTags,omitempty"`
85- }
86-
8769type optionalString struct {
8870 Set bool
8971 Value * string
@@ -154,22 +136,13 @@ func (r automationSettingsPatchRequest) isEmpty() bool {
154136 r .UseCategoryFromIndexer == nil &&
155137 r .UseCrossCategorySuffix == nil &&
156138 ! r .RunExternalProgramID .Set &&
157- (r .Completion == nil || r .Completion .isEmpty ()) &&
158139 r .RSSAutomationTags == nil &&
159140 r .SeededSearchTags == nil &&
160141 r .CompletionSearchTags == nil &&
161142 r .WebhookTags == nil &&
162143 r .InheritSourceTags == nil
163144}
164145
165- func (r completionSettingsPatchRequest ) isEmpty () bool {
166- return r .Enabled == nil &&
167- r .Categories == nil &&
168- r .Tags == nil &&
169- r .ExcludeCategories == nil &&
170- r .ExcludeTags == nil
171- }
172-
173146func applyAutomationSettingsPatch (settings * models.CrossSeedAutomationSettings , patch automationSettingsPatchRequest ) {
174147 if patch .Enabled != nil {
175148 settings .Enabled = * patch .Enabled
@@ -219,9 +192,6 @@ func applyAutomationSettingsPatch(settings *models.CrossSeedAutomationSettings,
219192 if patch .RunExternalProgramID .Set {
220193 settings .RunExternalProgramID = patch .RunExternalProgramID .Value
221194 }
222- if patch .Completion != nil {
223- applyCompletionSettingsPatch (& settings .Completion , patch .Completion )
224- }
225195 // Source-specific tagging
226196 if patch .RSSAutomationTags != nil {
227197 settings .RSSAutomationTags = * patch .RSSAutomationTags
@@ -240,24 +210,6 @@ func applyAutomationSettingsPatch(settings *models.CrossSeedAutomationSettings,
240210 }
241211}
242212
243- func applyCompletionSettingsPatch (dest * models.CrossSeedCompletionSettings , patch * completionSettingsPatchRequest ) {
244- if patch .Enabled != nil {
245- dest .Enabled = * patch .Enabled
246- }
247- if patch .Categories != nil {
248- dest .Categories = * patch .Categories
249- }
250- if patch .Tags != nil {
251- dest .Tags = * patch .Tags
252- }
253- if patch .ExcludeCategories != nil {
254- dest .ExcludeCategories = * patch .ExcludeCategories
255- }
256- if patch .ExcludeTags != nil {
257- dest .ExcludeTags = * patch .ExcludeTags
258- }
259- }
260-
261213type automationRunRequest struct {
262214 DryRun bool `json:"dryRun"`
263215}
@@ -614,17 +566,6 @@ func (h *CrossSeedHandler) UpdateAutomationSettings(w http.ResponseWriter, r *ht
614566 }
615567 }
616568
617- completion := models .DefaultCrossSeedCompletionSettings ()
618- if req .Completion != nil {
619- completion = models.CrossSeedCompletionSettings {
620- Enabled : req .Completion .Enabled ,
621- Categories : req .Completion .Categories ,
622- Tags : req .Completion .Tags ,
623- ExcludeCategories : req .Completion .ExcludeCategories ,
624- ExcludeTags : req .Completion .ExcludeTags ,
625- }
626- }
627-
628569 // Validate mutual exclusivity: cannot use both indexer category and .cross suffix
629570 if req .UseCategoryFromIndexer && req .UseCrossCategorySuffix {
630571 RespondError (w , http .StatusBadRequest , "Cannot enable both 'Use indexer name as category' and 'Add .cross category suffix'. These settings are mutually exclusive." )
@@ -645,7 +586,6 @@ func (h *CrossSeedHandler) UpdateAutomationSettings(w http.ResponseWriter, r *ht
645586 UseCategoryFromIndexer : req .UseCategoryFromIndexer ,
646587 UseCrossCategorySuffix : req .UseCrossCategorySuffix ,
647588 RunExternalProgramID : req .RunExternalProgramID ,
648- Completion : completion ,
649589 }
650590
651591 updated , err := h .service .UpdateAutomationSettings (r .Context (), settings )
0 commit comments