domain

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func SplitAny

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

func StringEqualFoldMulti

func StringEqualFoldMulti(s string, values ...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"`
	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"`
	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, actions []*Action, filterID int64) ([]*Action, error)
	DeleteByFilterID(ctx context.Context, filterID int) error
	FindByFilterID(ctx context.Context, filterID int) ([]*Action, error)
	List(ctx context.Context) ([]Action, error)
	Delete(actionID 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"`
}

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 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"`
}

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      string            `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"`
	Indexerr     FeedIndexer       `json:"-"`
	LastRun      time.Time         `json:"last_run"`
	LastRunData  string            `json:"last_run_data"`
}

type FeedCacheItem

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

type FeedCacheRepo

type FeedCacheRepo interface {
	Get(bucket string, key string) ([]byte, error)
	GetByBucket(ctx context.Context, bucket string) ([]FeedCacheItem, error)
	GetCountByBucket(ctx context.Context, bucket string) (int, error)
	Exists(bucket string, key string) (bool, error)
	Put(bucket string, key string, val []byte, ttl time.Time) error
	Delete(ctx context.Context, bucket string, key string) error
	DeleteBucket(ctx context.Context, bucket string) 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"`
	ExternalScriptEnabled       bool                   `json:"external_script_enabled,omitempty"`
	ExternalScriptCmd           string                 `json:"external_script_cmd,omitempty"`
	ExternalScriptArgs          string                 `json:"external_script_args,omitempty"`
	ExternalScriptExpectStatus  int                    `json:"external_script_expect_status,omitempty"`
	ExternalWebhookEnabled      bool                   `json:"external_webhook_enabled,omitempty"`
	ExternalWebhookHost         string                 `json:"external_webhook_host,omitempty"`
	ExternalWebhookData         string                 `json:"external_webhook_data,omitempty"`
	ExternalWebhookExpectStatus int                    `json:"external_webhook_expect_status,omitempty"`
	ActionsCount                int                    `json:"actions_count"`
	Actions                     []*Action              `json:"actions,omitempty"`
	Indexers                    []Indexer              `json:"indexers"`
	Downloads                   *FilterDownloads       `json:"-"`
}

func (Filter) CheckFilter

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

type FilterDownloads

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

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 {
	FindByID(ctx context.Context, filterID int) (*Filter, error)
	FindByIndexerIdentifier(ctx context.Context, indexer string) ([]Filter, error)
	Find(ctx context.Context, params FilterQueryParams) ([]Filter, error)
	ListFilters(ctx context.Context) ([]Filter, error)
	Store(ctx context.Context, filter Filter) (*Filter, error)
	Update(ctx context.Context, filter 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
	DeleteIndexerConnections(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"`
	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"`
	ExternalScriptEnabled       *bool                   `json:"external_script_enabled,omitempty"`
	ExternalScriptCmd           *string                 `json:"external_script_cmd,omitempty"`
	ExternalScriptArgs          *string                 `json:"external_script_args,omitempty"`
	ExternalScriptExpectStatus  *int                    `json:"external_script_expect_status,omitempty"`
	ExternalWebhookEnabled      *bool                   `json:"external_webhook_enabled,omitempty"`
	ExternalWebhookHost         *string                 `json:"external_webhook_host,omitempty"`
	ExternalWebhookData         *string                 `json:"external_webhook_data,omitempty"`
	ExternalWebhookExpectStatus *int                    `json:"external_webhook_expect_status,omitempty"`
	Actions                     []*Action               `json:"actions,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 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 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,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"`
}

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) ParseMatch

func (p *IndexerIRCParse) ParseMatch(baseURL string, vars map[string]string) (*IndexerIRCParseMatched, error)

type IndexerIRCParseLine

type IndexerIRCParseLine struct {
	Test    []string `json:"test"`
	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"`
}

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 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)
}

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 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"`
	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"`
	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(network *IrcNetwork) error
	UpdateNetwork(ctx context.Context, network *IrcNetwork) error
	StoreChannel(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 Macro

type Macro struct {
	TorrentName         string
	TorrentPathName     string
	TorrentHash         string
	TorrentID           string
	TorrentUrl          string
	TorrentDataRawBytes []byte
	MagnetURI           string
	GroupID             string
	Indexer             string
	Title               string
	Category            string
	Categories          []string
	Resolution          string
	Source              string
	HDR                 string
	FilterName          string
	Size                uint64
	Season              int
	Episode             int
	Year                int
	CurrentYear         int
	CurrentMonth        int
	CurrentDay          int
	CurrentHour         int
	CurrentMinute       int
	CurrentSecond       int
}

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"`
	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"
)

type Release

type Release struct {
	ID                          int64                 `json:"id"`
	FilterStatus                ReleaseFilterStatus   `json:"filter_status"`
	Rejections                  []string              `json:"rejections"`
	Indexer                     string                `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"`
	TorrentURL                  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:"torrent_name"` // full release name
	Size                        uint64                `json:"size"`
	Title                       string                `json:"title"` // Parsed title
	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:"-"`
	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:"-"`
	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:"-"`
	AdditionalSizeCheckRequired bool                  `json:"-"`
	FilterID                    int                   `json:"-"`
	Filter                      *Filter               `json:"-"`
	ActionStatus                []ReleaseActionStatus `json:"action_status"`
}

func NewRelease

func NewRelease(indexer string) *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) RejectionsString

func (r *Release) RejectionsString() string

func (*Release) ResolveMagnetUri

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

type ReleaseActionStatus

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

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 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) (*Release, error)
	Find(ctx context.Context, params ReleaseQueryParams) (res []*Release, nextCursor int64, count int64, err error)
	FindRecent(ctx context.Context) ([]*Release, error)
	GetIndexerOptions(ctx context.Context) ([]string, error)
	GetActionStatusByReleaseID(ctx context.Context, releaseID int64) ([]ReleaseActionStatus, error)
	Stats(ctx context.Context) (*ReleaseStats, error)
	StoreReleaseActionStatus(ctx context.Context, status *ReleaseActionStatus) error
	Delete(ctx context.Context) error
	CanDownloadShow(ctx context.Context, title string, season int, episode int) (bool, 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"`
}

type ReleaseTags

type ReleaseTags struct {
	Audio      []string
	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 TagInfo

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

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"`
}

func (TorrentBasic) ReleaseSizeBytes

func (t TorrentBasic) ReleaseSizeBytes() uint64

type Torznab

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

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, user User) error
}

Jump to

Keyboard shortcuts

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