feat(filters): set default Announce Type to NEW (#1890)

feat(filters): set default announce type NEW
This commit is contained in:
ze0s 2024-12-25 23:38:56 +01:00 committed by GitHub
parent 2c0672f4bc
commit ea20fb4f50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View file

@ -185,6 +185,10 @@ func (s *service) Store(ctx context.Context, filter *domain.Filter) error {
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 {
s.log.Error().Err(err).Msgf("could not store filter: %v", filter)
return err