feat(feeds): torznab parse category and freeleech (#492)

* feat(feeds): torznab parse freeleech

* feat(feeds): torznab parse categories
This commit is contained in:
ze0s 2022-10-14 18:01:04 +02:00 committed by GitHub
parent 924899d9f3
commit b7d2161fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 478 additions and 57 deletions

View file

@ -226,15 +226,10 @@ func (s *service) Test(ctx context.Context, feed *domain.Feed) error {
if feed.Type == string(domain.FeedTypeTorznab) {
// setup torznab Client
c := torznab.NewClient(torznab.Config{Host: feed.URL, ApiKey: feed.ApiKey, Log: subLogger})
caps, err := c.GetCaps()
if err != nil {
s.log.Error().Err(err).Msg("error testing feed")
return err
}
if caps == nil {
s.log.Error().Msg("could not test feed and get caps")
return errors.New("could not test feed and get caps")
if _, err := c.FetchFeed(); err != nil {
s.log.Error().Err(err).Msg("error getting torznab feed")
return err
}
}