domain

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordNotFound = sql.ErrNoRows
)
View Source
var ErrUnrecoverableError = errors.New("unrecoverable error")

Functions

func CleanReleaseTags added in v1.36.0

func CleanReleaseTags(tagString string) string

CleanReleaseTags trim delimiters and closest space

func SplitAny

func SplitAny(s string, seps string) []string

func StringEqualFoldMulti

func StringEqualFoldMulti(s string, values ...string) bool

func ValidReleasePushStatus added in v1.32.0

func ValidReleasePushStatus(s string) bool

Types

type APIKey

type APIKey struct {
	Name      string    `json:"name"`
	Key       string    `json:"key"`
	Scopes    []string  `json:"scopes"`
	CreatedAt time.Time `json:"created_at"`
}

type APIRepo

type APIRepo interface {
	Store(ctx context.Context, key *APIKey) error
	Delete(ctx context.Context, key string) error
	GetKeys(ctx context.Context) ([]APIKey, error)
}

type Action

type Action struct {
	ID                       int                 `json:"id"`
	Name                     string              `json:"name"`
	Type                     ActionType          `json:"type"`
	Enabled                  bool                `json:"enabled"`
	ExecCmd                  string              `json:"exec_cmd,omitempty"`
	ExecArgs                 string              `json:"exec_args,omitempty"`
	WatchFolder              string              `json:"watch_folder,omitempty"`
	Category                 string              `json:"category,omitempty"`
	Tags                     string              `json:"tags,omitempty"`
	Label                    string              `json:"label,omitempty"`
	SavePath                 string              `json:"save_path,omitempty"`
	Paused                   bool                `json:"paused,omitempty"`
	IgnoreRules              bool                `json:"ignore_rules,omitempty"`
	SkipHashCheck            bool                `json:"skip_hash_check,omitempty"`
	ContentLayout            ActionContentLayout `json:"content_layout,omitempty"`
	LimitUploadSpeed         int64               `json:"limit_upload_speed,omitempty"`
	LimitDownloadSpeed       int64               `json:"limit_download_speed,omitempty"`
	LimitRatio               float64             `json:"limit_ratio,omitempty"`
	LimitSeedTime            int64               `json:"limit_seed_time,omitempty"`
	PriorityLayout           PriorityLayout      `json:"priority,omitempty"`
	ReAnnounceSkip           bool                `json:"reannounce_skip,omitempty"`
	ReAnnounceDelete         bool                `json:"reannounce_delete,omitempty"`
	ReAnnounceInterval       int64               `json:"reannounce_interval,omitempty"`
	ReAnnounceMaxAttempts    int64               `json:"reannounce_max_attempts,omitempty"`
	WebhookHost              string              `json:"webhook_host,omitempty"`
	WebhookType              string              `json:"webhook_type,omitempty"`
	WebhookMethod            string              `json:"webhook_method,omitempty"`
	WebhookData              string              `json:"webhook_data,omitempty"`
	WebhookHeaders           []string            `json:"webhook_headers,omitempty"`
	ExternalDownloadClientID int32               `json:"external_download_client_id,omitempty"`
	ExternalDownloadClient   string              `json:"external_download_client,omitempty"`
	FilterID                 int                 `json:"filter_id,omitempty"`
	ClientID                 int32               `json:"client_id,omitempty"`
	Client                   *DownloadClient     `json:"client,omitempty"`
}

func (*Action) ParseMacros

func (a *Action) ParseMacros(release *Release) error

ParseMacros parse all macros on action

type ActionContentLayout

type ActionContentLayout string
const (
	ActionContentLayoutOriginal        ActionContentLayout = "ORIGINAL"
	ActionContentLayoutSubfolderNone   ActionContentLayout = "SUBFOLDER_NONE"
	ActionContentLayoutSubfolderCreate ActionContentLayout = "SUBFOLDER_CREATE"
)

type ActionRepo

type ActionRepo interface {
	Store(ctx context.Context, action Action) (*Action, error)
	StoreFilterActions(ctx context.Context, filterID int64, actions []*Action) ([]*Action, error)
	FindByFilterID(ctx context.Context, filterID int, active *bool) ([]*Action, error)
	List(ctx context.Context) ([]Action, error)
	Get(ctx context.Context, req *GetActionRequest) (*Action, error)
	Delete(ctx context.Context, req *DeleteActionRequest) error
	DeleteByFilterID(ctx context.Context, filterID int) error
	ToggleEnabled(actionID int) error
}

type ActionType

type ActionType string
const (
	ActionTypeTest         ActionType = "TEST"
	ActionTypeExec         ActionType = "EXEC"
	ActionTypeQbittorrent  ActionType = "QBITTORRENT"
	ActionTypeDelugeV1     ActionType = "DELUGE_V1"
	ActionTypeDelugeV2     ActionType = "DELUGE_V2"
	ActionTypeRTorrent     ActionType = "RTORRENT"
	ActionTypeTransmission ActionType = "TRANSMISSION"
	ActionTypePorla        ActionType = "PORLA"
	ActionTypeWatchFolder  ActionType = "WATCH_FOLDER"
	ActionTypeWebhook      ActionType = "WEBHOOK"
	ActionTypeRadarr       ActionType = "RADARR"
	ActionTypeSonarr       ActionType = "SONARR"
	ActionTypeLidarr       ActionType = "LIDARR"
	ActionTypeWhisparr     ActionType = "WHISPARR"
	ActionTypeReadarr      ActionType = "READARR"
	ActionTypeSabnzbd      ActionType = "SABNZBD"
)

type BasicAuth

type BasicAuth struct {
	Auth     bool   `json:"auth,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type ChannelHealth

type ChannelHealth struct {
	Name            string    `json:"name"`
	Monitoring      bool      `json:"monitoring"`
	MonitoringSince time.Time `json:"monitoring_since"`
	LastAnnounce    time.Time `json:"last_announce"`
}

type ChannelWithHealth

type ChannelWithHealth struct {
	ID              int64     `json:"id"`
	Enabled         bool      `json:"enabled"`
	Name            string    `json:"name"`
	Password        string    `json:"password"`
	Detached        bool      `json:"detached"`
	Monitoring      bool      `json:"monitoring"`
	MonitoringSince time.Time `json:"monitoring_since"`
	LastAnnounce    time.Time `json:"last_announce"`
}

type Config

type Config struct {
	Version             string
	ConfigPath          string
	Host                string `toml:"host"`
	Port                int    `toml:"port"`
	LogLevel            string `toml:"logLevel"`
	LogPath             string `toml:"logPath"`
	LogMaxSize          int    `toml:"logMaxSize"`
	LogMaxBackups       int    `toml:"logMaxBackups"`
	BaseURL             string `toml:"baseUrl"`
	SessionSecret       string `toml:"sessionSecret"`
	CustomDefinitions   string `toml:"customDefinitions"`
	CheckForUpdates     bool   `toml:"checkForUpdates"`
	DatabaseType        string `toml:"databaseType"`
	PostgresHost        string `toml:"postgresHost"`
	PostgresPort        int    `toml:"postgresPort"`
	PostgresDatabase    string `toml:"postgresDatabase"`
	PostgresUser        string `toml:"postgresUser"`
	PostgresPass        string `toml:"postgresPass"`
	PostgresSSLMode     string `toml:"postgresSSLMode"`
	PostgresExtraParams string `toml:"postgresExtraParams"`
}

type ConfigUpdate

type ConfigUpdate struct {
	Host            *string `json:"host,omitempty"`
	Port            *int    `json:"port,omitempty"`
	LogLevel        *string `json:"log_level,omitempty"`
	LogPath         *string `json:"log_path,omitempty"`
	BaseURL         *string `json:"base_url,omitempty"`
	CheckForUpdates *bool   `json:"check_for_updates,omitempty"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type DeleteActionRequest added in v1.26.0

type DeleteActionRequest struct {
	ActionId int
}

type DeleteReleaseRequest added in v1.28.0

type DeleteReleaseRequest struct {
	OlderThan int
}

type DownloadClient

type DownloadClient struct {
	ID            int                    `json:"id"`
	Name          string                 `json:"name"`
	Type          DownloadClientType     `json:"type"`
	Enabled       bool                   `json:"enabled"`
	Host          string                 `json:"host"`
	Port          int                    `json:"port"`
	TLS           bool                   `json:"tls"`
	TLSSkipVerify bool                   `json:"tls_skip_verify"`
	Username      string                 `json:"username"`
	Password      string                 `json:"password"`
	Settings      DownloadClientSettings `json:"settings,omitempty"`
}

func (DownloadClient) BuildLegacyHost

func (c DownloadClient) BuildLegacyHost() string

func (DownloadClient) Validate

func (c DownloadClient) Validate() error

Validate basic validation of client

type DownloadClientCached

type DownloadClientCached struct {
	Dc  *DownloadClient
	Qbt *qbittorrent.Client
}

type DownloadClientRepo

type DownloadClientRepo interface {
	List(ctx context.Context) ([]DownloadClient, error)
	FindByID(ctx context.Context, id int32) (*DownloadClient, error)
	Store(ctx context.Context, client DownloadClient) (*DownloadClient, error)
	Update(ctx context.Context, client DownloadClient) (*DownloadClient, error)
	Delete(ctx context.Context, clientID int) error
}

type DownloadClientRules

type DownloadClientRules struct {
	Enabled                     bool                        `json:"enabled"`
	MaxActiveDownloads          int                         `json:"max_active_downloads"`
	IgnoreSlowTorrents          bool                        `json:"ignore_slow_torrents"`
	IgnoreSlowTorrentsCondition IgnoreSlowTorrentsCondition `json:"ignore_slow_torrents_condition,omitempty"`
	DownloadSpeedThreshold      int64                       `json:"download_speed_threshold"`
	UploadSpeedThreshold        int64                       `json:"upload_speed_threshold"`
}

type DownloadClientSettings

type DownloadClientSettings struct {
	APIKey                   string              `json:"apikey,omitempty"`
	Basic                    BasicAuth           `json:"basic,omitempty"`
	Rules                    DownloadClientRules `json:"rules,omitempty"`
	ExternalDownloadClientId int                 `json:"external_download_client_id,omitempty"`
	ExternalDownloadClient   string              `json:"external_download_client,omitempty"`
}

type DownloadClientType

type DownloadClientType string
const (
	DownloadClientTypeQbittorrent  DownloadClientType = "QBITTORRENT"
	DownloadClientTypeDelugeV1     DownloadClientType = "DELUGE_V1"
	DownloadClientTypeDelugeV2     DownloadClientType = "DELUGE_V2"
	DownloadClientTypeRTorrent     DownloadClientType = "RTORRENT"
	DownloadClientTypeTransmission DownloadClientType = "TRANSMISSION"
	DownloadClientTypePorla        DownloadClientType = "PORLA"
	DownloadClientTypeRadarr       DownloadClientType = "RADARR"
	DownloadClientTypeSonarr       DownloadClientType = "SONARR"
	DownloadClientTypeLidarr       DownloadClientType = "LIDARR"
	DownloadClientTypeWhisparr     DownloadClientType = "WHISPARR"
	DownloadClientTypeReadarr      DownloadClientType = "READARR"
	DownloadClientTypeSabnzbd      DownloadClientType = "SABNZBD"
)

type DownloadTorrentFileResponse

type DownloadTorrentFileResponse struct {
	MetaInfo    *metainfo.MetaInfo
	TmpFileName string
}

type EventsReleasePushed

type EventsReleasePushed struct {
	ReleaseName    string
	Filter         string
	Indexer        string
	InfoHash       string
	Size           uint64
	Status         ReleasePushStatus
	Action         string
	ActionType     ActionType
	ActionClient   string
	Rejections     []string
	Protocol       ReleaseProtocol       // torrent, usenet
	Implementation ReleaseImplementation // irc, rss, api
	Timestamp      time.Time
}

type Feed

type Feed struct {
	ID           int               `json:"id"`
	Name         string            `json:"name"`
	Indexer      IndexerMinimal    `json:"indexer"`
	Type         string            `json:"type"`
	Enabled      bool              `json:"enabled"`
	URL          string            `json:"url"`
	Interval     int               `json:"interval"`
	Timeout      int               `json:"timeout"` // seconds
	MaxAge       int               `json:"max_age"` // seconds
	Capabilities []string          `json:"capabilities"`
	ApiKey       string            `json:"api_key"`
	Cookie       string            `json:"cookie"`
	Settings     *FeedSettingsJSON `json:"settings"`
	CreatedAt    time.Time         `json:"created_at"`
	UpdatedAt    time.Time         `json:"updated_at"`
	IndexerID    int               `json:"indexer_id,omitempty"`
	LastRun      time.Time         `json:"last_run"`
	LastRunData  string            `json:"last_run_data"`
	NextRun      time.Time         `json:"next_run"`
}

type FeedCacheItem

type FeedCacheItem struct {
	FeedId string    `json:"feed_id"`
	Key    string    `json:"key"`
	Value  []byte    `json:"value"`
	TTL    time.Time `json:"ttl"`
}

type FeedCacheRepo

type FeedCacheRepo interface {
	Get(feedId int, key string) ([]byte, error)
	GetByFeed(ctx context.Context, feedId int) ([]FeedCacheItem, error)
	GetCountByFeed(ctx context.Context, feedId int) (int, error)
	Exists(feedId int, key string) (bool, error)
	Put(feedId int, key string, val []byte, ttl time.Time) error
	PutMany(ctx context.Context, items []FeedCacheItem) error
	Delete(ctx context.Context, feedId int, key string) error
	DeleteByFeed(ctx context.Context, feedId int) error
	DeleteStale(ctx context.Context) error
}

type FeedDownloadType

type FeedDownloadType string
const (
	FeedDownloadTypeMagnet  FeedDownloadType = "MAGNET"
	FeedDownloadTypeTorrent FeedDownloadType = "TORRENT"
)

type FeedIndexer

type FeedIndexer struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Identifier string `json:"identifier"`
}

type FeedRepo

type FeedRepo interface {
	FindByID(ctx context.Context, id int) (*Feed, error)
	FindByIndexerIdentifier(ctx context.Context, indexer string) (*Feed, error)
	Find(ctx context.Context) ([]Feed, error)
	GetLastRunDataByID(ctx context.Context, id int) (string, error)
	Store(ctx context.Context, feed *Feed) error
	Update(ctx context.Context, feed *Feed) error
	UpdateLastRun(ctx context.Context, feedID int) error
	UpdateLastRunWithData(ctx context.Context, feedID int, data string) error
	ToggleEnabled(ctx context.Context, id int, enabled bool) error
	Delete(ctx context.Context, id int) error
}

type FeedSettings

type FeedSettings struct {
	MinInterval int              `json:"minInterval"`
	Settings    []IndexerSetting `json:"settings"`
}

type FeedSettingsJSON

type FeedSettingsJSON struct {
	DownloadType FeedDownloadType `json:"download_type"`
}

type FeedType

type FeedType string
const (
	FeedTypeTorznab FeedType = "TORZNAB"
	FeedTypeNewznab FeedType = "NEWZNAB"
	FeedTypeRSS     FeedType = "RSS"
)

type Filter

type Filter struct {
	ID                   int                    `json:"id"`
	Name                 string                 `json:"name"`
	Enabled              bool                   `json:"enabled"`
	CreatedAt            time.Time              `json:"created_at"`
	UpdatedAt            time.Time              `json:"updated_at"`
	MinSize              string                 `json:"min_size,omitempty"`
	MaxSize              string                 `json:"max_size,omitempty"`
	Delay                int                    `json:"delay,omitempty"`
	Priority             int32                  `json:"priority"`
	MaxDownloads         int                    `json:"max_downloads,omitempty"`
	MaxDownloadsUnit     FilterMaxDownloadsUnit `json:"max_downloads_unit,omitempty"`
	MatchReleases        string                 `json:"match_releases,omitempty"`
	ExceptReleases       string                 `json:"except_releases,omitempty"`
	UseRegex             bool                   `json:"use_regex,omitempty"`
	MatchReleaseGroups   string                 `json:"match_release_groups,omitempty"`
	ExceptReleaseGroups  string                 `json:"except_release_groups,omitempty"`
	Scene                bool                   `json:"scene,omitempty"`
	Origins              []string               `json:"origins,omitempty"`
	ExceptOrigins        []string               `json:"except_origins,omitempty"`
	Bonus                []string               `json:"bonus,omitempty"`
	Freeleech            bool                   `json:"freeleech,omitempty"`
	FreeleechPercent     string                 `json:"freeleech_percent,omitempty"`
	SmartEpisode         bool                   `json:"smart_episode"`
	Shows                string                 `json:"shows,omitempty"`
	Seasons              string                 `json:"seasons,omitempty"`
	Episodes             string                 `json:"episodes,omitempty"`
	Resolutions          []string               `json:"resolutions,omitempty"` // SD, 480i, 480p, 576p, 720p, 810p, 1080i, 1080p.
	Codecs               []string               `json:"codecs,omitempty"`      // XviD, DivX, x264, h.264 (or h264), mpeg2 (or mpeg-2), VC-1 (or VC1), WMV, Remux, h.264 Remux (or h264 Remux), VC-1 Remux (or VC1 Remux).
	Sources              []string               `json:"sources,omitempty"`     // DSR, PDTV, HDTV, HR.PDTV, HR.HDTV, DVDRip, DVDScr, BDr, BD5, BD9, BDRip, BRRip, DVDR, MDVDR, HDDVD, HDDVDRip, BluRay, WEB-DL, TVRip, CAM, R5, TELESYNC, TS, TELECINE, TC. TELESYNC and TS are synonyms (you don't need both). Same for TELECINE and TC
	Containers           []string               `json:"containers,omitempty"`
	MatchHDR             []string               `json:"match_hdr,omitempty"`
	ExceptHDR            []string               `json:"except_hdr,omitempty"`
	MatchOther           []string               `json:"match_other,omitempty"`
	ExceptOther          []string               `json:"except_other,omitempty"`
	Years                string                 `json:"years,omitempty"`
	Artists              string                 `json:"artists,omitempty"`
	Albums               string                 `json:"albums,omitempty"`
	MatchReleaseTypes    []string               `json:"match_release_types,omitempty"` // Album,Single,EP
	ExceptReleaseTypes   string                 `json:"except_release_types,omitempty"`
	Formats              []string               `json:"formats,omitempty"` // MP3, FLAC, Ogg, AAC, AC3, DTS
	Quality              []string               `json:"quality,omitempty"` // 192, 320, APS (VBR), V2 (VBR), V1 (VBR), APX (VBR), V0 (VBR), q8.x (VBR), Lossless, 24bit Lossless, Other
	Media                []string               `json:"media,omitempty"`   // CD, DVD, Vinyl, Soundboard, SACD, DAT, Cassette, WEB, Other
	PerfectFlac          bool                   `json:"perfect_flac,omitempty"`
	Cue                  bool                   `json:"cue,omitempty"`
	Log                  bool                   `json:"log,omitempty"`
	LogScore             int                    `json:"log_score,omitempty"`
	MatchCategories      string                 `json:"match_categories,omitempty"`
	ExceptCategories     string                 `json:"except_categories,omitempty"`
	MatchUploaders       string                 `json:"match_uploaders,omitempty"`
	ExceptUploaders      string                 `json:"except_uploaders,omitempty"`
	MatchLanguage        []string               `json:"match_language,omitempty"`
	ExceptLanguage       []string               `json:"except_language,omitempty"`
	Tags                 string                 `json:"tags,omitempty"`
	ExceptTags           string                 `json:"except_tags,omitempty"`
	TagsAny              string                 `json:"tags_any,omitempty"`
	ExceptTagsAny        string                 `json:"except_tags_any,omitempty"`
	TagsMatchLogic       string                 `json:"tags_match_logic,omitempty"`
	ExceptTagsMatchLogic string                 `json:"except_tags_match_logic,omitempty"`
	MatchReleaseTags     string                 `json:"match_release_tags,omitempty"`
	ExceptReleaseTags    string                 `json:"except_release_tags,omitempty"`
	UseRegexReleaseTags  bool                   `json:"use_regex_release_tags,omitempty"`
	MatchDescription     string                 `json:"match_description,omitempty"`
	ExceptDescription    string                 `json:"except_description,omitempty"`
	UseRegexDescription  bool                   `json:"use_regex_description,omitempty"`
	MinSeeders           int                    `json:"min_seeders,omitempty"`
	MaxSeeders           int                    `json:"max_seeders,omitempty"`
	MinLeechers          int                    `json:"min_leechers,omitempty"`
	MaxLeechers          int                    `json:"max_leechers,omitempty"`
	ActionsCount         int                    `json:"actions_count"`
	ActionsEnabledCount  int                    `json:"actions_enabled_count"`
	Actions              []*Action              `json:"actions,omitempty"`
	External             []FilterExternal       `json:"external,omitempty"`
	Indexers             []Indexer              `json:"indexers"`
	Downloads            *FilterDownloads       `json:"-"`
	Rejections           []string               `json:"-"`
}

func (*Filter) AddRejectionF added in v1.34.0

func (f *Filter) AddRejectionF(format string, v ...interface{})

func (*Filter) CheckFilter

func (f *Filter) CheckFilter(r *Release) ([]string, bool)

func (*Filter) CheckReleaseSize added in v1.34.0

func (f *Filter) CheckReleaseSize(releaseSize uint64) (bool, error)

func (*Filter) IsPerfectFLAC added in v1.36.0

func (f *Filter) IsPerfectFLAC(r *Release) ([]string, bool)

IsPerfectFLAC Perfect is "CD FLAC Cue Log 100% Lossless or 24bit Lossless"

func (*Filter) RejectionsString added in v1.34.0

func (f *Filter) RejectionsString(trim bool) string

func (*Filter) Sanitize added in v1.41.0

func (f *Filter) Sanitize() error

func (*Filter) Validate added in v1.34.0

func (f *Filter) Validate() error

type FilterDownloads

type FilterDownloads struct {
	HourCount  int
	DayCount   int
	WeekCount  int
	MonthCount int
	TotalCount int
}

type FilterExternal added in v1.29.0

type FilterExternal struct {
	ID                       int                `json:"id"`
	Name                     string             `json:"name"`
	Index                    int                `json:"index"`
	Type                     FilterExternalType `json:"type"`
	Enabled                  bool               `json:"enabled"`
	ExecCmd                  string             `json:"exec_cmd,omitempty"`
	ExecArgs                 string             `json:"exec_args,omitempty"`
	ExecExpectStatus         int                `json:"exec_expect_status,omitempty"`
	WebhookHost              string             `json:"webhook_host,omitempty"`
	WebhookMethod            string             `json:"webhook_method,omitempty"`
	WebhookData              string             `json:"webhook_data,omitempty"`
	WebhookHeaders           string             `json:"webhook_headers,omitempty"`
	WebhookExpectStatus      int                `json:"webhook_expect_status,omitempty"`
	WebhookRetryStatus       string             `json:"webhook_retry_status,omitempty"`
	WebhookRetryAttempts     int                `json:"webhook_retry_attempts,omitempty"`
	WebhookRetryDelaySeconds int                `json:"webhook_retry_delay_seconds,omitempty"`
	FilterId                 int                `json:"-"`
}

type FilterExternalType added in v1.29.0

type FilterExternalType string
const (
	ExternalFilterTypeExec    FilterExternalType = "EXEC"
	ExternalFilterTypeWebhook FilterExternalType = "WEBHOOK"
)

type FilterMaxDownloadsUnit

type FilterMaxDownloadsUnit string
const (
	FilterMaxDownloadsHour  FilterMaxDownloadsUnit = "HOUR"
	FilterMaxDownloadsDay   FilterMaxDownloadsUnit = "DAY"
	FilterMaxDownloadsWeek  FilterMaxDownloadsUnit = "WEEK"
	FilterMaxDownloadsMonth FilterMaxDownloadsUnit = "MONTH"
	FilterMaxDownloadsEver  FilterMaxDownloadsUnit = "EVER"
)

type FilterQueryParams

type FilterQueryParams struct {
	Sort    map[string]string
	Filters struct {
		Indexers []string
	}
	Search string
}

type FilterRepo

type FilterRepo interface {
	ListFilters(ctx context.Context) ([]Filter, error)
	Find(ctx context.Context, params FilterQueryParams) ([]Filter, error)
	FindByID(ctx context.Context, filterID int) (*Filter, error)
	FindByIndexerIdentifier(ctx context.Context, indexer string) ([]*Filter, error)
	FindExternalFiltersByID(ctx context.Context, filterId int) ([]FilterExternal, error)
	Store(ctx context.Context, filter *Filter) error
	Update(ctx context.Context, filter *Filter) error
	UpdatePartial(ctx context.Context, filter FilterUpdate) error
	ToggleEnabled(ctx context.Context, filterID int, enabled bool) error
	Delete(ctx context.Context, filterID int) error
	StoreIndexerConnection(ctx context.Context, filterID int, indexerID int) error
	StoreIndexerConnections(ctx context.Context, filterID int, indexers []Indexer) error
	StoreFilterExternal(ctx context.Context, filterID int, externalFilters []FilterExternal) error
	DeleteIndexerConnections(ctx context.Context, filterID int) error
	DeleteFilterExternal(ctx context.Context, filterID int) error
	GetDownloadsByFilterId(ctx context.Context, filterID int) (*FilterDownloads, error)
}

type FilterUpdate

type FilterUpdate struct {
	ID                   int                     `json:"id"`
	Name                 *string                 `json:"name,omitempty"`
	Enabled              *bool                   `json:"enabled,omitempty"`
	MinSize              *string                 `json:"min_size,omitempty"`
	MaxSize              *string                 `json:"max_size,omitempty"`
	Delay                *int                    `json:"delay,omitempty"`
	Priority             *int32                  `json:"priority,omitempty"`
	MaxDownloads         *int                    `json:"max_downloads,omitempty"`
	MaxDownloadsUnit     *FilterMaxDownloadsUnit `json:"max_downloads_unit,omitempty"`
	MatchReleases        *string                 `json:"match_releases,omitempty"`
	ExceptReleases       *string                 `json:"except_releases,omitempty"`
	UseRegex             *bool                   `json:"use_regex,omitempty"`
	MatchReleaseGroups   *string                 `json:"match_release_groups,omitempty"`
	ExceptReleaseGroups  *string                 `json:"except_release_groups,omitempty"`
	MatchReleaseTags     *string                 `json:"match_release_tags,omitempty"`
	ExceptReleaseTags    *string                 `json:"except_release_tags,omitempty"`
	UseRegexReleaseTags  *bool                   `json:"use_regex_release_tags,omitempty"`
	MatchDescription     *string                 `json:"match_description,omitempty"`
	ExceptDescription    *string                 `json:"except_description,omitempty"`
	UseRegexDescription  *bool                   `json:"use_regex_description,omitempty"`
	Scene                *bool                   `json:"scene,omitempty"`
	Origins              *[]string               `json:"origins,omitempty"`
	ExceptOrigins        *[]string               `json:"except_origins,omitempty"`
	Bonus                *[]string               `json:"bonus,omitempty"`
	Freeleech            *bool                   `json:"freeleech,omitempty"`
	FreeleechPercent     *string                 `json:"freeleech_percent,omitempty"`
	SmartEpisode         *bool                   `json:"smart_episode,omitempty"`
	Shows                *string                 `json:"shows,omitempty"`
	Seasons              *string                 `json:"seasons,omitempty"`
	Episodes             *string                 `json:"episodes,omitempty"`
	Resolutions          *[]string               `json:"resolutions,omitempty"` // SD, 480i, 480p, 576p, 720p, 810p, 1080i, 1080p.
	Codecs               *[]string               `json:"codecs,omitempty"`      // XviD, DivX, x264, h.264 (or h264), mpeg2 (or mpeg-2), VC-1 (or VC1), WMV, Remux, h.264 Remux (or h264 Remux), VC-1 Remux (or VC1 Remux).
	Sources              *[]string               `json:"sources,omitempty"`     // DSR, PDTV, HDTV, HR.PDTV, HR.HDTV, DVDRip, DVDScr, BDr, BD5, BD9, BDRip, BRRip, DVDR, MDVDR, HDDVD, HDDVDRip, BluRay, WEB-DL, TVRip, CAM, R5, TELESYNC, TS, TELECINE, TC. TELESYNC and TS are synonyms (you don't need both). Same for TELECINE and TC
	Containers           *[]string               `json:"containers,omitempty"`
	MatchHDR             *[]string               `json:"match_hdr,omitempty"`
	ExceptHDR            *[]string               `json:"except_hdr,omitempty"`
	MatchOther           *[]string               `json:"match_other,omitempty"`
	ExceptOther          *[]string               `json:"except_other,omitempty"`
	Years                *string                 `json:"years,omitempty"`
	Artists              *string                 `json:"artists,omitempty"`
	Albums               *string                 `json:"albums,omitempty"`
	MatchReleaseTypes    *[]string               `json:"match_release_types,omitempty"` // Album,Single,EP
	ExceptReleaseTypes   *string                 `json:"except_release_types,omitempty"`
	Formats              *[]string               `json:"formats,omitempty"` // MP3, FLAC, Ogg, AAC, AC3, DTS
	Quality              *[]string               `json:"quality,omitempty"` // 192, 320, APS (VBR), V2 (VBR), V1 (VBR), APX (VBR), V0 (VBR), q8.x (VBR), Lossless, 24bit Lossless, Other
	Media                *[]string               `json:"media,omitempty"`   // CD, DVD, Vinyl, Soundboard, SACD, DAT, Cassette, WEB, Other
	PerfectFlac          *bool                   `json:"perfect_flac,omitempty"`
	Cue                  *bool                   `json:"cue,omitempty"`
	Log                  *bool                   `json:"log,omitempty"`
	LogScore             *int                    `json:"log_score,omitempty"`
	MatchCategories      *string                 `json:"match_categories,omitempty"`
	ExceptCategories     *string                 `json:"except_categories,omitempty"`
	MatchUploaders       *string                 `json:"match_uploaders,omitempty"`
	ExceptUploaders      *string                 `json:"except_uploaders,omitempty"`
	MatchLanguage        *[]string               `json:"match_language,omitempty"`
	ExceptLanguage       *[]string               `json:"except_language,omitempty"`
	Tags                 *string                 `json:"tags,omitempty"`
	ExceptTags           *string                 `json:"except_tags,omitempty"`
	TagsAny              *string                 `json:"tags_any,omitempty"`
	ExceptTagsAny        *string                 `json:"except_tags_any,omitempty"`
	TagsMatchLogic       *string                 `json:"tags_match_logic,omitempty"`
	ExceptTagsMatchLogic *string                 `json:"except_tags_match_logic,omitempty"`
	MinSeeders           *int                    `json:"min_seeders,omitempty"`
	MaxSeeders           *int                    `json:"max_seeders,omitempty"`
	MinLeechers          *int                    `json:"min_leechers,omitempty"`
	MaxLeechers          *int                    `json:"max_leechers,omitempty"`
	Actions              []*Action               `json:"actions,omitempty"`
	External             []FilterExternal        `json:"external,omitempty"`
	Indexers             []Indexer               `json:"indexers,omitempty"`
}

type FindFunc

type FindFunc func(string) *TagInfo

FindFunc is the find signature..

func Find

func Find(infos ...*TagInfo) FindFunc

Find returns a func to find tag info.

type GetActionRequest added in v1.26.0

type GetActionRequest struct {
	Id int
}

type GetReleaseActionStatusRequest added in v1.26.0

type GetReleaseActionStatusRequest struct {
	Id int
}

type GetReleaseRequest added in v1.26.0

type GetReleaseRequest struct {
	Id int
}

type IRCAuth

type IRCAuth struct {
	Mechanism IRCAuthMechanism `json:"mechanism,omitempty"`
	Account   string           `json:"account,omitempty"`
	Password  string           `json:"password,omitempty"`
}

type IRCAuthMechanism

type IRCAuthMechanism string
const (
	IRCAuthMechanismNone      IRCAuthMechanism = "NONE"
	IRCAuthMechanismSASLPlain IRCAuthMechanism = "SASL_PLAIN"
	IRCAuthMechanismNickServ  IRCAuthMechanism = "NICKSERV"
)

type IRCManualProcessRequest added in v1.40.0

type IRCManualProcessRequest struct {
	NetworkId int64  `json:"-"`
	Server    string `json:"server"`
	Channel   string `json:"channel"`
	Nick      string `json:"nick"`
	Message   string `json:"msg"`
}

type IRCParser added in v1.36.0

type IRCParser interface {
	Parse(rls *Release, vars map[string]string) error
}

type IRCParserDefault added in v1.36.0

type IRCParserDefault struct{}

func (IRCParserDefault) Parse added in v1.36.0

func (p IRCParserDefault) Parse(rls *Release, _ map[string]string) error

type IRCParserGazelleGames added in v1.36.0

type IRCParserGazelleGames struct{}

func (IRCParserGazelleGames) Parse added in v1.36.0

func (p IRCParserGazelleGames) Parse(rls *Release, vars map[string]string) error

type IRCParserOrpheus added in v1.36.0

type IRCParserOrpheus struct{}

func (IRCParserOrpheus) Parse added in v1.36.0

func (p IRCParserOrpheus) Parse(rls *Release, vars map[string]string) error

type IRCParserRedacted added in v1.36.0

type IRCParserRedacted struct{}

IRCParserRedacted parser for Redacted announces

func (IRCParserRedacted) Parse added in v1.36.0

func (p IRCParserRedacted) Parse(rls *Release, vars map[string]string) error

type IgnoreSlowTorrentsCondition

type IgnoreSlowTorrentsCondition string
const (
	IgnoreSlowTorrentsModeAlways     IgnoreSlowTorrentsCondition = "ALWAYS"
	IgnoreSlowTorrentsModeMaxReached IgnoreSlowTorrentsCondition = "MAX_DOWNLOADS_REACHED"
)

type Indexer

type Indexer struct {
	ID             int64             `json:"id"`
	Name           string            `json:"name"`
	Identifier     string            `json:"identifier"`
	Enabled        bool              `json:"enabled"`
	Implementation string            `json:"implementation"`
	BaseURL        string            `json:"base_url,omitempty"`
	Settings       map[string]string `json:"settings,omitempty"`
}

type IndexerDefinition

type IndexerDefinition struct {
	ID             int               `json:"id,omitempty"`
	Name           string            `json:"name"`
	Identifier     string            `json:"identifier"`
	Implementation string            `json:"implementation"`
	BaseURL        string            `json:"base_url,omitempty"`
	Enabled        bool              `json:"enabled"`
	Description    string            `json:"description"`
	Language       string            `json:"language"`
	Privacy        string            `json:"privacy"`
	Protocol       string            `json:"protocol"`
	URLS           []string          `json:"urls"`
	Supports       []string          `json:"supports"`
	Settings       []IndexerSetting  `json:"settings,omitempty"`
	SettingsMap    map[string]string `json:"-"`
	IRC            *IndexerIRC       `json:"irc,omitempty"`
	Torznab        *Torznab          `json:"torznab,omitempty"`
	Newznab        *Newznab          `json:"newznab,omitempty"`
	RSS            *FeedSettings     `json:"rss,omitempty"`
}

func (IndexerDefinition) HasApi

func (i IndexerDefinition) HasApi() bool

type IndexerDefinitionCustom

type IndexerDefinitionCustom struct {
	ID             int               `json:"id,omitempty"`
	Name           string            `json:"name"`
	Identifier     string            `json:"identifier"`
	Implementation string            `json:"implementation"`
	BaseURL        string            `json:"base_url,omitempty"`
	Enabled        bool              `json:"enabled,omitempty"`
	Description    string            `json:"description"`
	Language       string            `json:"language"`
	Privacy        string            `json:"privacy"`
	Protocol       string            `json:"protocol"`
	URLS           []string          `json:"urls"`
	Supports       []string          `json:"supports"`
	Settings       []IndexerSetting  `json:"settings,omitempty"`
	SettingsMap    map[string]string `json:"-"`
	IRC            *IndexerIRC       `json:"irc,omitempty"`
	Torznab        *Torznab          `json:"torznab,omitempty"`
	Newznab        *Newznab          `json:"newznab,omitempty"`
	RSS            *FeedSettings     `json:"rss,omitempty"`
	Parse          *IndexerIRCParse  `json:"parse,omitempty"`
}

func (*IndexerDefinitionCustom) ToIndexerDefinition

func (i *IndexerDefinitionCustom) ToIndexerDefinition() *IndexerDefinition

type IndexerIRC

type IndexerIRC struct {
	Network     string            `json:"network"`
	Server      string            `json:"server"`
	Port        int               `json:"port"`
	TLS         bool              `json:"tls"`
	Channels    []string          `json:"channels"`
	Announcers  []string          `json:"announcers"`
	SettingsMap map[string]string `json:"-"`
	Settings    []IndexerSetting  `json:"settings"`
	Parse       *IndexerIRCParse  `json:"parse,omitempty"`
}

func (IndexerIRC) ValidAnnouncer

func (i IndexerIRC) ValidAnnouncer(announcer string) bool

func (IndexerIRC) ValidChannel

func (i IndexerIRC) ValidChannel(channel string) bool

type IndexerIRCParse

type IndexerIRCParse struct {
	Type          string                `json:"type"`
	ForceSizeUnit string                `json:"forcesizeunit"`
	Lines         []IndexerIRCParseLine `json:"lines"`
	Match         IndexerIRCParseMatch  `json:"match"`
}

func (*IndexerIRCParse) Parse added in v1.36.0

func (p *IndexerIRCParse) Parse(def *IndexerDefinition, vars map[string]string, rls *Release) error

type IndexerIRCParseLine

type IndexerIRCParseLine struct {
	Tests   []LineTest `json:"tests"`
	Pattern string     `json:"pattern"`
	Vars    []string   `json:"vars"`
	Ignore  bool       `json:"ignore"`
}

type IndexerIRCParseMatch

type IndexerIRCParseMatch struct {
	TorrentURL  string   `json:"torrenturl"`
	TorrentName string   `json:"torrentname"`
	InfoURL     string   `json:"infourl"`
	Encode      []string `json:"encode"`
}

func (*IndexerIRCParseMatch) ParseTorrentName added in v1.36.0

func (p *IndexerIRCParseMatch) ParseTorrentName(vars map[string]string, rls *Release) error

func (*IndexerIRCParseMatch) ParseURLs added in v1.36.0

func (p *IndexerIRCParseMatch) ParseURLs(baseURL string, vars map[string]string, rls *Release) error

type IndexerIRCParseMatched

type IndexerIRCParseMatched struct {
	InfoURL     string
	TorrentURL  string
	TorrentName string
}

type IndexerImplementation

type IndexerImplementation string
const (
	IndexerImplementationIRC     IndexerImplementation = "irc"
	IndexerImplementationTorznab IndexerImplementation = "torznab"
	IndexerImplementationNewznab IndexerImplementation = "newznab"
	IndexerImplementationRSS     IndexerImplementation = "rss"
	IndexerImplementationLegacy  IndexerImplementation = ""
)

func (IndexerImplementation) String

func (i IndexerImplementation) String() string

type IndexerMinimal added in v1.41.0

type IndexerMinimal struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Identifier string `json:"identifier"`
}

type IndexerRepo

type IndexerRepo interface {
	Store(ctx context.Context, indexer Indexer) (*Indexer, error)
	Update(ctx context.Context, indexer Indexer) (*Indexer, error)
	List(ctx context.Context) ([]Indexer, error)
	Delete(ctx context.Context, id int) error
	FindByFilterID(ctx context.Context, id int) ([]Indexer, error)
	FindByID(ctx context.Context, id int) (*Indexer, error)
	ToggleEnabled(ctx context.Context, indexerID int, enabled bool) error
}

type IndexerSetting

type IndexerSetting struct {
	Name        string `json:"name"`
	Required    bool   `json:"required,omitempty"`
	Type        string `json:"type"`
	Value       string `json:"value,omitempty"`
	Label       string `json:"label"`
	Default     string `json:"default,omitempty"`
	Description string `json:"description,omitempty"`
	Help        string `json:"help,omitempty"`
	Regex       string `json:"regex,omitempty"`
}

type IndexerTestApiRequest

type IndexerTestApiRequest struct {
	IndexerId  int    `json:"id,omitempty"`
	Identifier string `json:"identifier,omitempty"`
	ApiUser    string `json:"api_user,omitempty"`
	ApiKey     string `json:"api_key"`
}

type IrcChannel

type IrcChannel struct {
	ID         int64  `json:"id"`
	Enabled    bool   `json:"enabled"`
	Name       string `json:"name"`
	Password   string `json:"password"`
	Detached   bool   `json:"detached"`
	Monitoring bool   `json:"monitoring"`
}

type IrcMessage added in v1.27.0

type IrcMessage struct {
	Channel string    `json:"channel"`
	Nick    string    `json:"nick"`
	Message string    `json:"msg"`
	Time    time.Time `json:"time"`
}

func (IrcMessage) Bytes added in v1.27.0

func (m IrcMessage) Bytes() []byte

func (IrcMessage) ToJsonString added in v1.27.0

func (m IrcMessage) ToJsonString() string

type IrcNetwork

type IrcNetwork struct {
	ID             int64        `json:"id"`
	Name           string       `json:"name"`
	Enabled        bool         `json:"enabled"`
	Server         string       `json:"server"`
	Port           int          `json:"port"`
	TLS            bool         `json:"tls"`
	Pass           string       `json:"pass"`
	Nick           string       `json:"nick"`
	Auth           IRCAuth      `json:"auth,omitempty"`
	InviteCommand  string       `json:"invite_command"`
	UseBouncer     bool         `json:"use_bouncer"`
	BouncerAddr    string       `json:"bouncer_addr"`
	BotMode        bool         `json:"bot_mode"`
	Channels       []IrcChannel `json:"channels"`
	Connected      bool         `json:"connected"`
	ConnectedSince *time.Time   `json:"connected_since"`
}

type IrcNetworkWithHealth

type IrcNetworkWithHealth struct {
	ID               int64               `json:"id"`
	Name             string              `json:"name"`
	Enabled          bool                `json:"enabled"`
	Server           string              `json:"server"`
	Port             int                 `json:"port"`
	TLS              bool                `json:"tls"`
	Pass             string              `json:"pass"`
	Nick             string              `json:"nick"`
	Auth             IRCAuth             `json:"auth,omitempty"`
	InviteCommand    string              `json:"invite_command"`
	UseBouncer       bool                `json:"use_bouncer"`
	BouncerAddr      string              `json:"bouncer_addr"`
	BotMode          bool                `json:"bot_mode"`
	CurrentNick      string              `json:"current_nick"`
	PreferredNick    string              `json:"preferred_nick"`
	Channels         []ChannelWithHealth `json:"channels"`
	Connected        bool                `json:"connected"`
	ConnectedSince   time.Time           `json:"connected_since"`
	ConnectionErrors []string            `json:"connection_errors"`
	Healthy          bool                `json:"healthy"`
}

type IrcRepo

type IrcRepo interface {
	StoreNetwork(ctx context.Context, network *IrcNetwork) error
	UpdateNetwork(ctx context.Context, network *IrcNetwork) error
	StoreChannel(ctx context.Context, networkID int64, channel *IrcChannel) error
	UpdateChannel(channel *IrcChannel) error
	UpdateInviteCommand(networkID int64, invite string) error
	StoreNetworkChannels(ctx context.Context, networkID int64, channels []IrcChannel) error
	CheckExistingNetwork(ctx context.Context, network *IrcNetwork) (*IrcNetwork, error)
	FindActiveNetworks(ctx context.Context) ([]IrcNetwork, error)
	ListNetworks(ctx context.Context) ([]IrcNetwork, error)
	ListChannels(networkID int64) ([]IrcChannel, error)
	GetNetworkByID(ctx context.Context, id int64) (*IrcNetwork, error)
	DeleteNetwork(ctx context.Context, id int64) error
}

type LineTest added in v1.34.0

type LineTest struct {
	Line   string            `json:"line"`
	Expect map[string]string `json:"expect"`
}

type Macro

type Macro struct {
	TorrentName         string
	TorrentPathName     string
	TorrentHash         string
	TorrentID           string
	TorrentUrl          string
	TorrentDataRawBytes []byte
	MagnetURI           string
	Group               string
	GroupID             string
	DownloadUrl         string
	InfoUrl             string
	Indexer             string
	IndexerName         string
	IndexerIdentifier   string
	Title               string
	Type                string
	Category            string
	Categories          []string
	Resolution          string
	Source              string
	HDR                 string
	FilterID            int
	FilterName          string
	Size                uint64
	SizeString          string
	Season              int
	Episode             int
	Year                int
	CurrentYear         int
	CurrentMonth        int
	CurrentDay          int
	CurrentHour         int
	CurrentMinute       int
	CurrentSecond       int
	Tags                string
	Artists             string
}

func NewMacro

func NewMacro(release Release) Macro

func (Macro) MustParse

func (m Macro) MustParse(text string) string

MustParse takes a string and replaces valid vars

func (Macro) Parse

func (m Macro) Parse(text string) (string, error)

Parse takes a string and replaces valid vars

type Newznab

type Newznab struct {
	MinInterval int              `json:"minInterval"`
	Settings    []IndexerSetting `json:"settings"`
}

type Notification

type Notification struct {
	ID        int              `json:"id"`
	Name      string           `json:"name"`
	Type      NotificationType `json:"type"`
	Enabled   bool             `json:"enabled"`
	Events    []string         `json:"events"`
	Token     string           `json:"token"`
	APIKey    string           `json:"api_key"`
	Webhook   string           `json:"webhook"`
	Title     string           `json:"title"`
	Icon      string           `json:"icon"`
	Username  string           `json:"username"`
	Host      string           `json:"host"`
	Password  string           `json:"password"`
	Channel   string           `json:"channel"`
	Rooms     string           `json:"rooms"`
	Targets   string           `json:"targets"`
	Devices   string           `json:"devices"`
	Priority  int32            `json:"priority"`
	Topic     string           `json:"topic"`
	CreatedAt time.Time        `json:"created_at"`
	UpdatedAt time.Time        `json:"updated_at"`
}

type NotificationEvent

type NotificationEvent string
const (
	NotificationEventAppUpdateAvailable NotificationEvent = "APP_UPDATE_AVAILABLE"
	NotificationEventPushApproved       NotificationEvent = "PUSH_APPROVED"
	NotificationEventPushRejected       NotificationEvent = "PUSH_REJECTED"
	NotificationEventPushError          NotificationEvent = "PUSH_ERROR"
	NotificationEventIRCDisconnected    NotificationEvent = "IRC_DISCONNECTED"
	NotificationEventIRCReconnected     NotificationEvent = "IRC_RECONNECTED"
	NotificationEventTest               NotificationEvent = "TEST"
)

type NotificationEventArr

type NotificationEventArr []NotificationEvent

type NotificationPayload

type NotificationPayload struct {
	Subject        string
	Message        string
	Event          NotificationEvent
	ReleaseName    string
	Filter         string
	Indexer        string
	InfoHash       string
	Size           uint64
	Status         ReleasePushStatus
	Action         string
	ActionType     ActionType
	ActionClient   string
	Rejections     []string
	Protocol       ReleaseProtocol       // torrent, usenet
	Implementation ReleaseImplementation // irc, rss, api
	Timestamp      time.Time
}

type NotificationQueryParams

type NotificationQueryParams struct {
	Limit   uint64
	Offset  uint64
	Sort    map[string]string
	Filters struct {
		Indexers   []string
		PushStatus string
	}
	Search string
}

type NotificationRepo

type NotificationRepo interface {
	List(ctx context.Context) ([]Notification, error)
	Find(ctx context.Context, params NotificationQueryParams) ([]Notification, int, error)
	FindByID(ctx context.Context, id int) (*Notification, error)
	Store(ctx context.Context, notification Notification) (*Notification, error)
	Update(ctx context.Context, notification Notification) (*Notification, error)
	Delete(ctx context.Context, notificationID int) error
}

type NotificationSender

type NotificationSender interface {
	Send(event NotificationEvent, payload NotificationPayload) error
	CanSend(event NotificationEvent) bool
}

type NotificationType

type NotificationType string
const (
	NotificationTypeDiscord    NotificationType = "DISCORD"
	NotificationTypeNotifiarr  NotificationType = "NOTIFIARR"
	NotificationTypeIFTTT      NotificationType = "IFTTT"
	NotificationTypeJoin       NotificationType = "JOIN"
	NotificationTypeMattermost NotificationType = "MATTERMOST"
	NotificationTypeMatrix     NotificationType = "MATRIX"
	NotificationTypePushBullet NotificationType = "PUSH_BULLET"
	NotificationTypePushover   NotificationType = "PUSHOVER"
	NotificationTypeRocketChat NotificationType = "ROCKETCHAT"
	NotificationTypeSlack      NotificationType = "SLACK"
	NotificationTypeTelegram   NotificationType = "TELEGRAM"
	NotificationTypeGotify     NotificationType = "GOTIFY"
	NotificationTypeNtfy       NotificationType = "NTFY"
	NotificationTypeLunaSea    NotificationType = "LUNASEA"
	NotificationTypeShoutrrr   NotificationType = "SHOUTRRR"
)

type PriorityLayout added in v1.35.0

type PriorityLayout string
const (
	PriorityLayoutMax     PriorityLayout = "MAX"
	PriorityLayoutMin     PriorityLayout = "MIN"
	PriorityLayoutDefault PriorityLayout = ""
)

type Release

type Release struct {
	ID                          int64                 `json:"id"`
	FilterStatus                ReleaseFilterStatus   `json:"filter_status"`
	Rejections                  []string              `json:"rejections"`
	Indexer                     IndexerMinimal        `json:"indexer"`
	FilterName                  string                `json:"filter"`
	Protocol                    ReleaseProtocol       `json:"protocol"`
	Implementation              ReleaseImplementation `json:"implementation"` // irc, rss, api
	Timestamp                   time.Time             `json:"timestamp"`
	InfoURL                     string                `json:"info_url"`
	DownloadURL                 string                `json:"download_url"`
	MagnetURI                   string                `json:"-"`
	GroupID                     string                `json:"group_id"`
	TorrentID                   string                `json:"torrent_id"`
	TorrentTmpFile              string                `json:"-"`
	TorrentDataRawBytes         []byte                `json:"-"`
	TorrentHash                 string                `json:"-"`
	TorrentName                 string                `json:"name"` // full release name
	Size                        uint64                `json:"size"`
	Title                       string                `json:"title"` // Parsed title
	Description                 string                `json:"-"`
	Category                    string                `json:"category"`
	Categories                  []string              `json:"categories,omitempty"`
	Season                      int                   `json:"season"`
	Episode                     int                   `json:"episode"`
	Year                        int                   `json:"year"`
	Resolution                  string                `json:"resolution"`
	Source                      string                `json:"source"`
	Codec                       []string              `json:"codec"`
	Container                   string                `json:"container"`
	HDR                         []string              `json:"hdr"`
	Audio                       []string              `json:"-"`
	AudioChannels               string                `json:"-"`
	AudioFormat                 string                `json:"-"`
	Bitrate                     string                `json:"-"`
	Group                       string                `json:"group"`
	Region                      string                `json:"-"`
	Language                    []string              `json:"-"`
	Proper                      bool                  `json:"proper"`
	Repack                      bool                  `json:"repack"`
	Website                     string                `json:"website"`
	Artists                     string                `json:"-"`
	Type                        string                `json:"type"` // Album,Single,EP
	LogScore                    int                   `json:"-"`
	HasCue                      bool                  `json:"-"`
	HasLog                      bool                  `json:"-"`
	Origin                      string                `json:"origin"` // P2P, Internal
	Tags                        []string              `json:"-"`
	ReleaseTags                 string                `json:"-"`
	Freeleech                   bool                  `json:"-"`
	FreeleechPercent            int                   `json:"-"`
	Bonus                       []string              `json:"-"`
	Uploader                    string                `json:"uploader"`
	PreTime                     string                `json:"pre_time"`
	Other                       []string              `json:"-"`
	RawCookie                   string                `json:"-"`
	Seeders                     int                   `json:"-"`
	Leechers                    int                   `json:"-"`
	AdditionalSizeCheckRequired bool                  `json:"-"`
	FilterID                    int                   `json:"-"`
	Filter                      *Filter               `json:"-"`
	ActionStatus                []ReleaseActionStatus `json:"action_status"`
}

func NewRelease

func NewRelease(indexer IndexerMinimal) *Release

func (*Release) AddRejectionF

func (r *Release) AddRejectionF(format string, v ...interface{})

func (*Release) CleanupTemporaryFiles

func (r *Release) CleanupTemporaryFiles()

func (*Release) DownloadTorrentFile

func (r *Release) DownloadTorrentFile() error

func (*Release) DownloadTorrentFileCtx

func (r *Release) DownloadTorrentFileCtx(ctx context.Context) error

func (*Release) HasMagnetUri

func (r *Release) HasMagnetUri() bool

HasMagnetUri check uf MagnetURI is set or empty

func (*Release) MapVars

func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) error

MapVars map vars from regex captures to fields on release

func (*Release) ParseReleaseTagsString

func (r *Release) ParseReleaseTagsString(tags string)

func (*Release) ParseSizeBytesString

func (r *Release) ParseSizeBytesString(size string)

ParseSizeBytesString If there are parsing errors, then it keeps the original (or default size 0) Otherwise, it will update the size only if the new size is bigger than the previous one.

func (*Release) ParseString

func (r *Release) ParseString(title string)

func (*Release) Raw added in v1.37.0

func (r *Release) Raw(s string) rls.Release

func (*Release) RejectionsString

func (r *Release) RejectionsString(trim bool) string

func (*Release) ResolveMagnetUri

func (r *Release) ResolveMagnetUri(ctx context.Context) error

type ReleaseActionRetryReq added in v1.26.0

type ReleaseActionRetryReq struct {
	ReleaseId      int
	ActionStatusId int
	ActionId       int
}

type ReleaseActionStatus

type ReleaseActionStatus struct {
	ID         int64             `json:"id"`
	Status     ReleasePushStatus `json:"status"`
	Action     string            `json:"action"`
	ActionID   int64             `json:"action_id"`
	Type       ActionType        `json:"type"`
	Client     string            `json:"client"`
	Filter     string            `json:"filter"`
	FilterID   int64             `json:"filter_id"`
	Rejections []string          `json:"rejections"`
	ReleaseID  int64             `json:"release_id"`
	Timestamp  time.Time         `json:"timestamp"`
}

func NewReleaseActionStatus

func NewReleaseActionStatus(action *Action, release *Release) *ReleaseActionStatus

type ReleaseFilterStatus

type ReleaseFilterStatus string
const (
	ReleaseStatusFilterApproved ReleaseFilterStatus = "FILTER_APPROVED"
	ReleaseStatusFilterPending  ReleaseFilterStatus = "PENDING"
)

type ReleaseImplementation

type ReleaseImplementation string
const (
	ReleaseImplementationIRC     ReleaseImplementation = "IRC"
	ReleaseImplementationTorznab ReleaseImplementation = "TORZNAB"
	ReleaseImplementationNewznab ReleaseImplementation = "NEWZNAB"
	ReleaseImplementationRSS     ReleaseImplementation = "RSS"
)

func (ReleaseImplementation) String

func (r ReleaseImplementation) String() string

type ReleaseProcessReq added in v1.40.0

type ReleaseProcessReq struct {
	IndexerIdentifier     string   `json:"indexer_identifier"`
	IndexerImplementation string   `json:"indexer_implementation"`
	AnnounceLines         []string `json:"announce_lines"`
}

type ReleaseProtocol

type ReleaseProtocol string
const (
	ReleaseProtocolTorrent ReleaseProtocol = "torrent"
	ReleaseProtocolNzb     ReleaseProtocol = "usenet"
)

func (ReleaseProtocol) String

func (r ReleaseProtocol) String() string

type ReleasePushStatus

type ReleasePushStatus string
const (
	ReleasePushStatusPending  ReleasePushStatus = "PENDING" // Initial status
	ReleasePushStatusApproved ReleasePushStatus = "PUSH_APPROVED"
	ReleasePushStatusRejected ReleasePushStatus = "PUSH_REJECTED"
	ReleasePushStatusErr      ReleasePushStatus = "PUSH_ERROR"
)

func (ReleasePushStatus) String

func (r ReleasePushStatus) String() string

type ReleaseQueryParams

type ReleaseQueryParams struct {
	Limit   uint64
	Offset  uint64
	Cursor  uint64
	Sort    map[string]string
	Filters struct {
		Indexers   []string
		PushStatus string
	}
	Search string
}

type ReleaseRepo

type ReleaseRepo interface {
	Store(ctx context.Context, release *Release) error
	Find(ctx context.Context, params ReleaseQueryParams) (res []*Release, nextCursor int64, count int64, err error)
	FindRecent(ctx context.Context) ([]*Release, error)
	Get(ctx context.Context, req *GetReleaseRequest) (*Release, error)
	GetIndexerOptions(ctx context.Context) ([]string, error)
	Stats(ctx context.Context) (*ReleaseStats, error)
	Delete(ctx context.Context, req *DeleteReleaseRequest) error
	CanDownloadShow(ctx context.Context, title string, season int, episode int) (bool, error)

	GetActionStatus(ctx context.Context, req *GetReleaseActionStatusRequest) (*ReleaseActionStatus, error)
	StoreReleaseActionStatus(ctx context.Context, status *ReleaseActionStatus) error
}

type ReleaseStats

type ReleaseStats struct {
	TotalCount          int64 `json:"total_count"`
	FilteredCount       int64 `json:"filtered_count"`
	FilterRejectedCount int64 `json:"filter_rejected_count"`
	PushApprovedCount   int64 `json:"push_approved_count"`
	PushRejectedCount   int64 `json:"push_rejected_count"`
	PushErrorCount      int64 `json:"push_error_count"`
}

type ReleaseTags

type ReleaseTags struct {
	Audio        []string
	AudioBitrate string
	AudioFormat  string
	LogScore     int
	HasLog       bool
	HasCue       bool
	Bonus        []string
	Channels     string
	Codec        string
	Container    string
	HDR          []string
	Origin       string
	Other        []string
	Resolution   string
	Source       string
}

func ParseReleaseTagString

func ParseReleaseTagString(tags string) ReleaseTags

func ParseReleaseTags

func ParseReleaseTags(tags []string) ReleaseTags

type SendIrcCmdRequest added in v1.27.0

type SendIrcCmdRequest struct {
	NetworkId int64  `json:"network_id"`
	Server    string `json:"server"`
	Channel   string `json:"channel"`
	Nick      string `json:"nick"`
	Message   string `json:"msg"`
}

type TagInfo

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

func (*TagInfo) FindMatch added in v1.36.0

func (info *TagInfo) FindMatch(t string) []string

FindMatch returns the regexp matches.

func (*TagInfo) Match

func (info *TagInfo) Match(s string) bool

Match matches the tag info to s.

func (*TagInfo) RE

func (info *TagInfo) RE() string

RE returns the tag info regexp string.

func (*TagInfo) Regexp

func (info *TagInfo) Regexp() string

Regexp returns the tag info regexp.

func (*TagInfo) Tag

func (info *TagInfo) Tag() string

Tag returns the tag info tag.

func (*TagInfo) Title

func (info *TagInfo) Title() string

Title returns the tag info title.

type TorrentBasic

type TorrentBasic struct {
	Id        string `json:"Id"`
	TorrentId string `json:"TorrentId,omitempty"`
	InfoHash  string `json:"InfoHash"`
	Size      string `json:"Size"`
	Uploader  string `json:"Uploader"`
}

func (TorrentBasic) ReleaseSizeBytes

func (t TorrentBasic) ReleaseSizeBytes() uint64

type Torznab

type Torznab struct {
	MinInterval int              `json:"minInterval"`
	Settings    []IndexerSetting `json:"settings"`
}

type UpdateUserRequest added in v1.35.0

type UpdateUserRequest struct {
	UsernameCurrent string `json:"username_username"`
	UsernameNew     string `json:"username_new"`
	PasswordCurrent string `json:"password_current"`
	PasswordNew     string `json:"password_new"`
	PasswordNewHash string `json:"-"`
}

type User

type User struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserRepo

type UserRepo interface {
	GetUserCount(ctx context.Context) (int, error)
	FindByUsername(ctx context.Context, username string) (*User, error)
	Store(ctx context.Context, req CreateUserRequest) error
	Update(ctx context.Context, req UpdateUserRequest) error
	Delete(ctx context.Context, username string) error
}

Jump to

Keyboard shortcuts

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