Files
nabarr/rss/struct.go
dev 719528a06b
Some checks failed
Build / build (push) Failing after 13m30s
feat: enrich RSS items without IDs via TMDB title search
Items from RSS feeds that have no media ID (tmdb/imdb/tvdb) are now
enriched automatically using TMDB's search API. The release name is
parsed to extract a clean title and year, then searched against TMDB
to retrieve the TMDB ID before validation.

- Add media/tmdb package with SearchMovies, SearchShows, and
  ExtractTitleAndYear (parses torrent release names)
- Add EnrichFeedItemWithTmdbId to media.Client, called in rss/process.go
  before the ID validation switch
- Add --run-now flag to nabarr run to trigger all feeds immediately
- Wire media.Client through rss.Client and rssJob
- Merge feature/add-tag-option (tag support for Sonarr/Radarr)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 16:53:54 +00:00

47 lines
913 B
Go

package rss
import (
"net/http"
"time"
"github.com/robfig/cron/v3"
"github.com/rs/zerolog"
"github.com/l3uddz/nabarr/cache"
"github.com/l3uddz/nabarr/cmd/nabarr/pvr"
"github.com/l3uddz/nabarr/media"
)
type feedItem struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
Cron string `yaml:"cron"`
CacheDuration time.Duration `yaml:"cache_duration"`
Pvrs []string `yaml:"pvrs"`
}
type Config struct {
Feeds []feedItem `yaml:"feeds"`
Verbosity string `yaml:"verbosity,omitempty"`
}
type rssJob struct {
name string
log zerolog.Logger
http *http.Client
mediaClient *media.Client
url string
pvrs map[string]pvr.PVR
attempts int
errors []error
cron *cron.Cron
cache *cache.Client
cacheDuration time.Duration
cacheFiltersHash string
jobID cron.EntryID
}