mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(releases): parse isScene as Origins SCENE (#716)
* fix(releases): parse isScene as Origins SCENE * fix(releases): remove isScene
This commit is contained in:
parent
da416451e5
commit
5607184522
3 changed files with 7 additions and 14 deletions
|
@ -75,7 +75,6 @@ type Release struct {
|
|||
Artists string `json:"-"`
|
||||
Type string `json:"type"` // Album,Single,EP
|
||||
LogScore int `json:"-"`
|
||||
IsScene bool `json:"-"`
|
||||
Origin string `json:"origin"` // P2P, Internal
|
||||
Tags []string `json:"-"`
|
||||
ReleaseTags string `json:"-"`
|
||||
|
@ -485,21 +484,18 @@ func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) erro
|
|||
}
|
||||
|
||||
if scene, err := getStringMapValue(varMap, "scene"); err == nil {
|
||||
r.IsScene = StringEqualFoldMulti(scene, "true", "yes", "1")
|
||||
if StringEqualFoldMulti(scene, "true", "yes", "1") {
|
||||
r.Origin = "SCENE"
|
||||
}
|
||||
}
|
||||
|
||||
// set origin. P2P, SCENE, O-SCENE and Internal
|
||||
if origin, err := getStringMapValue(varMap, "origin"); err == nil {
|
||||
r.Origin = origin
|
||||
|
||||
if r.IsScene {
|
||||
r.Origin = "SCENE"
|
||||
}
|
||||
}
|
||||
|
||||
if internal, err := getStringMapValue(varMap, "internal"); err == nil {
|
||||
i := StringEqualFoldMulti(internal, "internal", "yes", "1")
|
||||
if i {
|
||||
if StringEqualFoldMulti(internal, "internal", "yes", "1") {
|
||||
r.Origin = "INTERNAL"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -639,7 +639,6 @@ func TestRelease_ParseString(t *testing.T) {
|
|||
Artists: tt.fields.Artists,
|
||||
Type: tt.fields.Type,
|
||||
LogScore: tt.fields.LogScore,
|
||||
IsScene: tt.fields.IsScene,
|
||||
Origin: tt.fields.Origin,
|
||||
Tags: tt.fields.Tags,
|
||||
ReleaseTags: tt.fields.ReleaseTags,
|
||||
|
@ -741,7 +740,6 @@ func TestRelease_DownloadTorrentFile(t *testing.T) {
|
|||
Artists string
|
||||
Type string
|
||||
LogScore int
|
||||
IsScene bool
|
||||
Origin string
|
||||
Tags []string
|
||||
ReleaseTags string
|
||||
|
@ -838,7 +836,6 @@ func TestRelease_DownloadTorrentFile(t *testing.T) {
|
|||
Artists: tt.fields.Artists,
|
||||
Type: tt.fields.Type,
|
||||
LogScore: tt.fields.LogScore,
|
||||
IsScene: tt.fields.IsScene,
|
||||
Origin: tt.fields.Origin,
|
||||
Tags: tt.fields.Tags,
|
||||
ReleaseTags: tt.fields.ReleaseTags,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue