mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat: add usenet support (#543)
* feat(autobrr): implement usenet support * feat(sonarr): implement usenet support * feat(radarr): implement usenet support * feat(announce): implement usenet support * announce: cast a line * feat(release): prevent unknown protocol transfer * release: lines for days. * feat: add newznab and sabnzbd support * feat: add category to sabnzbd * feat(newznab): map categories * feat(newznab): map categories --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com> Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
b2d93d50c5
commit
13a74f7cc8
29 changed files with 1588 additions and 37 deletions
|
@ -48,9 +48,37 @@ type IndexerDefinition struct {
|
|||
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"`
|
||||
}
|
||||
|
||||
type IndexerImplementation string
|
||||
|
||||
const (
|
||||
IndexerImplementationIRC IndexerImplementation = "irc"
|
||||
IndexerImplementationTorznab IndexerImplementation = "torznab"
|
||||
IndexerImplementationNewznab IndexerImplementation = "newznab"
|
||||
IndexerImplementationRSS IndexerImplementation = "rss"
|
||||
IndexerImplementationLegacy IndexerImplementation = ""
|
||||
)
|
||||
|
||||
func (i IndexerImplementation) String() string {
|
||||
switch i {
|
||||
case IndexerImplementationIRC:
|
||||
return "irc"
|
||||
case IndexerImplementationTorznab:
|
||||
return "torznab"
|
||||
case IndexerImplementationNewznab:
|
||||
return "newznab"
|
||||
case IndexerImplementationRSS:
|
||||
return "rss"
|
||||
case IndexerImplementationLegacy:
|
||||
return ""
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func (i IndexerDefinition) HasApi() bool {
|
||||
for _, a := range i.Supports {
|
||||
if a == "api" {
|
||||
|
@ -77,6 +105,7 @@ type IndexerDefinitionCustom struct {
|
|||
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"`
|
||||
}
|
||||
|
@ -99,6 +128,7 @@ func (i *IndexerDefinitionCustom) ToIndexerDefinition() *IndexerDefinition {
|
|||
SettingsMap: i.SettingsMap,
|
||||
IRC: i.IRC,
|
||||
Torznab: i.Torznab,
|
||||
Newznab: i.Newznab,
|
||||
RSS: i.RSS,
|
||||
}
|
||||
|
||||
|
@ -126,6 +156,11 @@ type Torznab struct {
|
|||
Settings []IndexerSetting `json:"settings"`
|
||||
}
|
||||
|
||||
type Newznab struct {
|
||||
MinInterval int `json:"minInterval"`
|
||||
Settings []IndexerSetting `json:"settings"`
|
||||
}
|
||||
|
||||
type FeedSettings struct {
|
||||
MinInterval int `json:"minInterval"`
|
||||
Settings []IndexerSetting `json:"settings"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue