mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(filters): set default Announce Type
to NEW
(#1890)
feat(filters): set default announce type NEW
This commit is contained in:
parent
2c0672f4bc
commit
ea20fb4f50
3 changed files with 15 additions and 3 deletions
|
@ -1347,5 +1347,9 @@ CREATE INDEX release_hybrid_index
|
||||||
UPDATE irc_network
|
UPDATE irc_network
|
||||||
SET invite_command = REPLACE(invite_command, '#ptp-announce-dev', '#ptp-announce')
|
SET invite_command = REPLACE(invite_command, '#ptp-announce-dev', '#ptp-announce')
|
||||||
WHERE invite_command LIKE '%#ptp-announce-dev%';
|
WHERE invite_command LIKE '%#ptp-announce-dev%';
|
||||||
|
`,
|
||||||
|
`UPDATE filter
|
||||||
|
SET announce_types = '{"NEW"}'
|
||||||
|
WHERE announce_types = '{}';
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1992,5 +1992,9 @@ CREATE INDEX release_hybrid_index
|
||||||
`UPDATE irc_network
|
`UPDATE irc_network
|
||||||
SET invite_command = REPLACE(invite_command, '#ptp-announce-dev', '#ptp-announce')
|
SET invite_command = REPLACE(invite_command, '#ptp-announce-dev', '#ptp-announce')
|
||||||
WHERE invite_command LIKE '%#ptp-announce-dev%';
|
WHERE invite_command LIKE '%#ptp-announce-dev%';
|
||||||
|
`,
|
||||||
|
`UPDATE filter
|
||||||
|
SET announce_types = '{"NEW"}'
|
||||||
|
WHERE announce_types = '{}';
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,6 +185,10 @@ func (s *service) Store(ctx context.Context, filter *domain.Filter) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if filter.AnnounceTypes == nil || len(filter.AnnounceTypes) == 0 {
|
||||||
|
filter.AnnounceTypes = []string{string(domain.AnnounceTypeNew)}
|
||||||
|
}
|
||||||
|
|
||||||
if err := s.repo.Store(ctx, filter); err != nil {
|
if err := s.repo.Store(ctx, filter); err != nil {
|
||||||
s.log.Error().Err(err).Msgf("could not store filter: %v", filter)
|
s.log.Error().Err(err).Msgf("could not store filter: %v", filter)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue