Documentation
¶
Index ¶
- func InferLanguage(title string) string
- func MatchesLanguage(title string, keywords []string) bool
- func MatchesQuality(title string, keywords []string) bool
- type Client
- func (c *Client) DownloadNZB(ctx context.Context, downloadURL string) ([]byte, error)
- func (c *Client) Search(ctx context.Context, imdbID, searchType string, categories []int, ...) ([]NZBResult, error)
- func (c *Client) SearchByTVDB(ctx context.Context, tvdbID, searchType string, categories []int, ...) ([]NZBResult, error)
- type NZBResult
- type ReleaseMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InferLanguage ¶
InferLanguage detects the most likely language from a release title using common scene/group naming conventions. Returns a short label like "Spanish", "French", or "" when not detected. PTN's language support is limited for European releases so we use custom keyword matching here.
func MatchesLanguage ¶
MatchesLanguage returns true when title contains at least one of the language keywords (case-insensitive). Returns true when keywords is empty (no filter).
func MatchesQuality ¶
MatchesQuality returns true when title contains at least one of the quality keywords (case-insensitive). Returns true when keywords is empty (no filter).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Prowlarr API client backed by golift/starr.
func (*Client) DownloadNZB ¶
DownloadNZB fetches the NZB file content from the given Prowlarr download URL.
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, imdbID, searchType string, categories []int, season, episode int) ([]NZBResult, error)
Search queries Prowlarr for NZB releases matching the given IMDB ID and categories. searchType should be "movie", "tvsearch", or "search". season and episode are optional (pass 0 to omit); used for tvsearch to scope results to a specific episode. Results are returned sorted by publish date descending (newest first).
func (*Client) SearchByTVDB ¶
func (c *Client) SearchByTVDB(ctx context.Context, tvdbID, searchType string, categories []int, season, episode int) ([]NZBResult, error)
SearchByTVDB queries Prowlarr for NZB releases using TVDB ID and categories. This is primarily used by TV series lookups when indexers support TvdbId but not ImdbId.
type NZBResult ¶
type NZBResult struct {
Title string
DownloadURL string
Size int64
PublishDate time.Time
Indexer string
}
NZBResult represents a single search result from Prowlarr.
type ReleaseMeta ¶
type ReleaseMeta struct {
Language string // "Spanish", "French", etc.
FlagEmoji string // "🇪🇸", "🇫🇷", etc. (empty for English/unknown)
LangCode string // "Esp", "Fra", "Deu", etc. (empty if unknown)
QualityLabel string // "4K", "FHD", "HD", "SD", or quality string (e.g. "WEB-DL")
Resolution string // from PTN: "720p", "1080p", "2160p"
Quality string // from PTN: "WEB-DL", "BluRay", etc.
Codec string // from PTN: "x264", "x265", "HEVC", etc.
Audio string // from PTN: "AAC", "DTS", etc.
ParsedTitle string // PTN-parsed title (e.g. "La película")
Year int // PTN-parsed year
}
ReleaseMeta holds inferred metadata from a release title.
func InferReleaseMeta ¶
func InferReleaseMeta(title string) ReleaseMeta
InferReleaseMeta parses a release title and returns detected metadata. Uses PTN for quality/resolution/codec/audio and custom logic for language.