starrs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(sql string) string

Escape tries to make queries values safer.

func FromSlash added in v0.1.2

func FromSlash(path string) string

FromSlash returns the result of replacing each slash character in path with a separator character.

func Startup

func Startup(ctx context.Context, starrs *Starrs, log *logs.Logger, app mnd.App)

Startup runs after wails initializes so we can save the context.

Types

type AppConfig

type AppConfig struct {
	SSL     bool          // verify ssl cert?
	Form    bool          // Use form login instead of basic auth?
	Timeout time.Duration // How long to wait for the app's API.
	App     string        // Radarr, Sonarr, etc
	Name    string        // Custom name: Radarr2, Radarr4k, etc.
	URL     string        // url to app.
	User    string        // username for app.
	Pass    string        // password for app.
	Key     string        // api key for app.
	DBPath  string        // path to database for app.
}

AppConfig is the configuration for an instance.

type AppTable

type AppTable map[string]TableColumn

AppTable is a simple name map.

func AppTables

func AppTables(app string) AppTable

AppTables returns the primary item table for an app.

type DataReply

type DataReply struct {
	Msg  string
	Data any
}

DataReply is a generic reply with a message and data.

type Entry

type Entry struct {
	ID   uint64
	Name *string
	Path string
}

Entry is used as a return value for tables with paths.

type Instances

type Instances map[string][]AppConfig

Instances is the configured list of instances. The map key is the instance type, e.g. Lidarr.

func (Instances) Copy

func (i Instances) Copy() Instances

Copy the instances list. Using copies provides thread safety at the risk of inconsistency.

type MigratorInfo

type MigratorInfo struct {
	Table       AppTable            // Names of main and sub tables.
	RootFolders []string            // Configured Root Folders.
	Invalid     map[string][]*Entry // Derived from items not located in root folders.
	Folders     TableCountMap       // Derived from both tables.
	Recycle     string              // Recycle Bin
}

MigratorInfo is full of info about the current root folders. This data gets sent to the front end any time there is a change.

type RootFolders

type RootFolders struct {
	Msg  string
	Info *MigratorInfo
}

RootFolders is the response to the front end when changing or deleting root folders.

type Starrs

type Starrs struct {
	// contains filtered or unexported fields
}

Starrs holds the running data and provides the frontend a place to interact with starr instances and their databases.

func (*Starrs) AppProfiles

func (s *Starrs) AppProfiles(config *AppConfig) (any, error)

func (*Starrs) BlockList

func (s *Starrs) BlockList(config *AppConfig, pageSize, page int, sortKey, sortDir string) (any, error)

func (*Starrs) CustomFilters

func (s *Starrs) CustomFilters(config *AppConfig) (any, error)

func (*Starrs) DeleteBlockList

func (s *Starrs) DeleteBlockList(config *AppConfig, listID int64) (any, error)

func (*Starrs) DeleteDownloader

func (s *Starrs) DeleteDownloader(config *AppConfig, clientID int64) (any, error)

func (*Starrs) DeleteExclusion

func (s *Starrs) DeleteExclusion(config *AppConfig, exclusionID int64) (any, error)

func (*Starrs) DeleteImportList

func (s *Starrs) DeleteImportList(config *AppConfig, listID int64) (any, error)

func (*Starrs) DeleteIndexer

func (s *Starrs) DeleteIndexer(config *AppConfig, indexerID int64) (any, error)

func (*Starrs) DeleteQualityProfile

func (s *Starrs) DeleteQualityProfile(config *AppConfig, profileID int64) (any, error)

func (*Starrs) DeleteRootFolder

func (s *Starrs) DeleteRootFolder(config *AppConfig, folder string) (*RootFolders, error)

DeleteRootFolder removes a root folder.

func (*Starrs) Downloaders

func (s *Starrs) Downloaders(config *AppConfig) (any, error)

func (*Starrs) Exclusions

func (s *Starrs) Exclusions(config *AppConfig) (any, error)

func (*Starrs) ImportLists

func (s *Starrs) ImportLists(config *AppConfig) (any, error)

func (*Starrs) Indexers

func (s *Starrs) Indexers(config *AppConfig) (any, error)

func (*Starrs) MetadataProfiles

func (s *Starrs) MetadataProfiles(config *AppConfig) (any, error)

func (*Starrs) MigratorInfo

func (s *Starrs) MigratorInfo(config *AppConfig) (*MigratorInfo, error)

MigratorInfo returns the current info about root folders.

func (*Starrs) QualityProfiles

func (s *Starrs) QualityProfiles(config *AppConfig) (any, error)

func (*Starrs) RootFolders

func (s *Starrs) RootFolders(config *AppConfig) (any, error)

func (*Starrs) Tags

func (s *Starrs) Tags(config *AppConfig) (map[int]string, error)

func (*Starrs) TestInstance

func (s *Starrs) TestInstance(config *AppConfig) (string, error)

func (*Starrs) TestLidarrDownloadClient

func (s *Starrs) TestLidarrDownloadClient(config *AppConfig, client *lidarr.DownloadClientInput) (string, error)

func (*Starrs) TestLidarrImportList

func (s *Starrs) TestLidarrImportList(config *AppConfig, list *lidarr.ImportListInput) (string, error)

func (*Starrs) TestLidarrIndexer

func (s *Starrs) TestLidarrIndexer(config *AppConfig, indexer *lidarr.IndexerInput) (string, error)

func (*Starrs) TestProwlarrDownloadClient

func (s *Starrs) TestProwlarrDownloadClient(config *AppConfig, client *prowlarr.DownloadClientInput) (string, error)

func (*Starrs) TestProwlarrIndexer

func (s *Starrs) TestProwlarrIndexer(config *AppConfig, indexer *prowlarr.IndexerInput) (string, error)

func (*Starrs) TestRadarrDownloadClient

func (s *Starrs) TestRadarrDownloadClient(config *AppConfig, client *radarr.DownloadClientInput) (string, error)

func (*Starrs) TestRadarrImportList

func (s *Starrs) TestRadarrImportList(config *AppConfig, list *radarr.ImportListInput) (string, error)

func (*Starrs) TestRadarrIndexer

func (s *Starrs) TestRadarrIndexer(config *AppConfig, indexer *radarr.IndexerInput) (string, error)

func (*Starrs) TestReadarrDownloadClient

func (s *Starrs) TestReadarrDownloadClient(config *AppConfig, client *readarr.DownloadClientInput) (string, error)

func (*Starrs) TestReadarrImportList

func (s *Starrs) TestReadarrImportList(config *AppConfig, list *readarr.ImportListInput) (string, error)

func (*Starrs) TestReadarrIndexer

func (s *Starrs) TestReadarrIndexer(config *AppConfig, indexer *readarr.IndexerInput) (string, error)

func (*Starrs) TestSonarrDownloadClient

func (s *Starrs) TestSonarrDownloadClient(config *AppConfig, client *sonarr.DownloadClientInput) (string, error)

func (*Starrs) TestSonarrImportList

func (s *Starrs) TestSonarrImportList(config *AppConfig, list *sonarr.ImportListInput) (string, error)

func (*Starrs) TestSonarrIndexer

func (s *Starrs) TestSonarrIndexer(config *AppConfig, indexer *sonarr.IndexerInput) (string, error)

func (*Starrs) TestWhisparrDownloadClient

func (s *Starrs) TestWhisparrDownloadClient(config *AppConfig, client *sonarr.DownloadClientInput) (string, error)

func (*Starrs) TestWhisparrImportList

func (s *Starrs) TestWhisparrImportList(config *AppConfig, list *sonarr.ImportListInput) (string, error)

func (*Starrs) TestWhisparrIndexer

func (s *Starrs) TestWhisparrIndexer(config *AppConfig, indexer *sonarr.IndexerInput) (string, error)

func (*Starrs) UpdateInvalidItems

func (s *Starrs) UpdateInvalidItems(
	config *AppConfig,
	table string,
	newPath string,
	ids map[int64]bool,
) (*RootFolders, error)

func (*Starrs) UpdateLidarrDownloadClient

func (s *Starrs) UpdateLidarrDownloadClient(
	config *AppConfig,
	force bool,
	downloader *lidarr.DownloadClientInput,
) (*DataReply, error)

func (*Starrs) UpdateLidarrExclusion

func (s *Starrs) UpdateLidarrExclusion(
	config *AppConfig,
	exclusion *lidarr.Exclusion,
) (*DataReply, error)

func (*Starrs) UpdateLidarrImportList

func (s *Starrs) UpdateLidarrImportList(
	config *AppConfig,
	force bool,
	list *lidarr.ImportListInput,
) (*DataReply, error)

func (*Starrs) UpdateLidarrIndexer

func (s *Starrs) UpdateLidarrIndexer(
	config *AppConfig,
	force bool,
	indexer *lidarr.IndexerInput,
) (*DataReply, error)

func (*Starrs) UpdateLidarrQualityProfile

func (s *Starrs) UpdateLidarrQualityProfile(
	config *AppConfig,
	profile *lidarr.QualityProfile,
) (*DataReply, error)

func (*Starrs) UpdateProwlarrDownloadClient

func (s *Starrs) UpdateProwlarrDownloadClient(
	config *AppConfig,
	force bool,
	downloader *prowlarr.DownloadClientInput,
) (*DataReply, error)

func (*Starrs) UpdateProwlarrIndexer

func (s *Starrs) UpdateProwlarrIndexer(
	config *AppConfig,
	force bool,
	indexer *prowlarr.IndexerInput,
) (*DataReply, error)

func (*Starrs) UpdateRadarrDownloadClient

func (s *Starrs) UpdateRadarrDownloadClient(
	config *AppConfig,
	force bool,
	downloader *radarr.DownloadClientInput,
) (*DataReply, error)

func (*Starrs) UpdateRadarrExclusion

func (s *Starrs) UpdateRadarrExclusion(
	config *AppConfig,
	exclusion *radarr.Exclusion,
) (*DataReply, error)

func (*Starrs) UpdateRadarrImportList

func (s *Starrs) UpdateRadarrImportList(
	config *AppConfig,
	force bool,
	list *radarr.ImportListInput,
) (*DataReply, error)

func (*Starrs) UpdateRadarrIndexer

func (s *Starrs) UpdateRadarrIndexer(
	config *AppConfig,
	force bool,
	indexer *radarr.IndexerInput,
) (*DataReply, error)

func (*Starrs) UpdateRadarrQualityProfile

func (s *Starrs) UpdateRadarrQualityProfile(
	config *AppConfig,
	profile *radarr.QualityProfile,
) (*DataReply, error)

func (*Starrs) UpdateReadarrDownloadClient

func (s *Starrs) UpdateReadarrDownloadClient(
	config *AppConfig,
	force bool,
	downloader *readarr.DownloadClientInput,
) (*DataReply, error)

func (*Starrs) UpdateReadarrExclusion

func (s *Starrs) UpdateReadarrExclusion(
	config *AppConfig,
	exclusion *readarr.Exclusion,
) (*DataReply, error)

func (*Starrs) UpdateReadarrImportList

func (s *Starrs) UpdateReadarrImportList(
	config *AppConfig,
	force bool,
	list *readarr.ImportListInput,
) (*DataReply, error)

func (*Starrs) UpdateReadarrIndexer

func (s *Starrs) UpdateReadarrIndexer(
	config *AppConfig,
	force bool,
	indexer *readarr.IndexerInput,
) (*DataReply, error)

func (*Starrs) UpdateReadarrQualityProfile

func (s *Starrs) UpdateReadarrQualityProfile(
	config *AppConfig,
	profile *readarr.QualityProfile,
) (*DataReply, error)

func (*Starrs) UpdateRecycleBin

func (s *Starrs) UpdateRecycleBin(config *AppConfig, newPath string) (*RootFolders, error)

func (*Starrs) UpdateRootFolder

func (s *Starrs) UpdateRootFolder(config *AppConfig, oldPath, newPath string) (*RootFolders, error)

UpdateRootFolder changes the path for a root folder. It updates all the items with the folder.

func (*Starrs) UpdateSonarrDownloadClient

func (s *Starrs) UpdateSonarrDownloadClient(
	config *AppConfig,
	force bool,
	downloader *sonarr.DownloadClientInput,
) (*DataReply, error)

func (*Starrs) UpdateSonarrExclusion

func (s *Starrs) UpdateSonarrExclusion(
	config *AppConfig,
	exclusion *sonarr.Exclusion,
) (*DataReply, error)

func (*Starrs) UpdateSonarrImportList

func (s *Starrs) UpdateSonarrImportList(
	config *AppConfig,
	force bool,
	list *sonarr.ImportListInput,
) (*DataReply, error)

func (*Starrs) UpdateSonarrIndexer

func (s *Starrs) UpdateSonarrIndexer(
	config *AppConfig,
	force bool,
	indexer *sonarr.IndexerInput,
) (*DataReply, error)

func (*Starrs) UpdateSonarrQualityProfile

func (s *Starrs) UpdateSonarrQualityProfile(
	config *AppConfig,
	profile *sonarr.QualityProfile,
) (*DataReply, error)

func (*Starrs) UpdateWhisparrDownloadClient

func (s *Starrs) UpdateWhisparrDownloadClient(
	config *AppConfig,
	force bool,
	downloader *sonarr.DownloadClientInput,
) (*DataReply, error)

func (*Starrs) UpdateWhisparrExclusion

func (s *Starrs) UpdateWhisparrExclusion(
	config *AppConfig,
	exclusion *sonarr.Exclusion,
) (*DataReply, error)

func (*Starrs) UpdateWhisparrImportList

func (s *Starrs) UpdateWhisparrImportList(
	config *AppConfig,
	force bool,
	list *sonarr.ImportListInput,
) (*DataReply, error)

func (*Starrs) UpdateWhisparrIndexer

func (s *Starrs) UpdateWhisparrIndexer(
	config *AppConfig,
	force bool,
	indexer *sonarr.IndexerInput,
) (*DataReply, error)

func (*Starrs) UpdateWhisparrQualityProfile

func (s *Starrs) UpdateWhisparrQualityProfile(
	config *AppConfig,
	profile *sonarr.QualityProfile,
) (*DataReply, error)

type TableColumn

type TableColumn struct {
	Table  string
	Column string
	Name   string
}

TableColumn is used to pull paths from specific columns in specific tables.

type TableCountMap

type TableCountMap map[string]map[string]int

TableCountMap is a map of table name => root folder => count. Used to count items mapped to a root folder from a specific table.

type TableFileMap

type TableFileMap map[TableColumn][]*Entry

TableFileMap is a map of table name => item ID => item Path Used to display info or update paths on a table. XXX: This is too complicated.

Jump to

Keyboard shortcuts

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