arrsvc

package
v0.1.120 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: GPL-2.0, GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package arrsvc composes the github.com/cplieger/arrapi Sonarr and Radarr clients with subflux's subtitle-specific operations: "wanted" iteration (which library items need a subtitle search), exclude-tag name resolution, and a fire-and-forget rescan. The raw library reads, per-item lookups, history polling, and connectivity ping are promoted from the embedded arrapi client unchanged, so this package adds only the app-level behavior arrapi deliberately does not provide.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Radarr

type Radarr struct {
	*arrapi.Radarr
}

Radarr composes arrapi.Radarr with subflux's wanted-movie iteration, exclude-tag resolution, and error-only rescan.

func NewRadarr

func NewRadarr(baseURL, apiKey string) (*Radarr, error)

NewRadarr builds a Radarr service for the given base URL and API key.

func (*Radarr) GetWantedMovies

func (r *Radarr) GetWantedMovies(ctx context.Context, excludeTagIDs map[int]struct{}, fn func(arrapi.Movie) error) error

GetWantedMovies invokes fn for every movie that needs a subtitle search. It fetches the full movie list first (closing that connection), then iterates locally, skipping movies with an excluded tag or no file.

func (*Radarr) RescanMovie

func (r *Radarr) RescanMovie(ctx context.Context, movieID int) error

RescanMovie asks Radarr to rescan the movie's folder for new or changed files. Fire-and-forget, like RescanSeries.

func (*Radarr) ResolveExcludeTagIDs

func (r *Radarr) ResolveExcludeTagIDs(ctx context.Context, names []string, logMissing bool) map[int]struct{}

ResolveExcludeTagIDs is the Radarr-side counterpart.

type Sonarr

type Sonarr struct {
	*arrapi.Sonarr
}

Sonarr composes arrapi.Sonarr with subflux's wanted-episode iteration, exclude-tag resolution, and error-only rescan.

func NewSonarr

func NewSonarr(baseURL, apiKey string) (*Sonarr, error)

NewSonarr builds a Sonarr service for the given base URL and API key.

func (*Sonarr) GetWantedEpisodes

func (s *Sonarr) GetWantedEpisodes(ctx context.Context, excludeTagIDs map[int]struct{}, fn func(arrapi.Series, arrapi.Episode) error) error

GetWantedEpisodes invokes fn for every episode that needs a subtitle search. It fetches the full series list first (closing that connection), then fetches each non-excluded series' episodes concurrently (bounded to 6 goroutines), then invokes fn sequentially. A series whose episode fetch keeps failing is logged and skipped rather than aborting the whole scan.

func (*Sonarr) RescanSeries

func (s *Sonarr) RescanSeries(ctx context.Context, seriesID int) error

RescanSeries asks Sonarr to rescan the series' folder for new or changed files (subflux calls this after writing a subtitle). It is fire-and-forget: arrapi returns the queued command, which subflux does not poll, so only the error is surfaced.

func (*Sonarr) ResolveExcludeTagIDs

func (s *Sonarr) ResolveExcludeTagIDs(ctx context.Context, names []string, logMissing bool) map[int]struct{}

ResolveExcludeTagIDs returns the arr tag IDs matching the given tag names. When logMissing is true, names with no matching tag are logged once at INFO (coverage passes false to avoid repeating the message on every page load).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL