feat: respect pvr exclusions (#37)
This commit is contained in:
@@ -4,9 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/lefelys/state"
|
||||
|
||||
"github.com/l3uddz/nabarr"
|
||||
"github.com/l3uddz/nabarr/media"
|
||||
"github.com/lefelys/state"
|
||||
)
|
||||
|
||||
func (c *Client) QueueFeedItem(item *media.FeedItem) {
|
||||
@@ -171,6 +172,27 @@ func (c *Client) queueProcessor(tail state.ShutdownTail) {
|
||||
continue
|
||||
}
|
||||
|
||||
// lookup pvr exclusions
|
||||
exclusions, err := c.getExclusions()
|
||||
if err != nil {
|
||||
c.log.Error().
|
||||
Err(err).
|
||||
Msg("Failed retrieving pvr exclusions")
|
||||
continue
|
||||
}
|
||||
|
||||
if _, ok := exclusions[s.TmdbId]; ok {
|
||||
// item was in pvr exclusions
|
||||
c.log.Debug().
|
||||
Str("pvr_title", s.Title).
|
||||
Int("pvr_year", s.Year).
|
||||
Str("pvr_imdb_id", s.ImdbId).
|
||||
Int("pvr_tmdb_id", s.TmdbId).
|
||||
Str("feed_name", feedItem.Feed).
|
||||
Msg("Item found in pvr exclusions")
|
||||
continue
|
||||
}
|
||||
|
||||
// add item to pvr
|
||||
c.log.Debug().
|
||||
Str("feed_title", mediaItem.FeedTitle).
|
||||
|
||||
Reference in New Issue
Block a user