overrides win
This commit is contained in:
12
main.go
12
main.go
@@ -156,7 +156,7 @@ func one(ctx context.Context, outd, inf string, patterns []string, overrides Fie
|
||||
continue
|
||||
}
|
||||
|
||||
found := overrides
|
||||
var found Fields
|
||||
groupNames := re.SubexpNames()
|
||||
groups := re.FindStringSubmatch(f)
|
||||
for i := 1; i < len(groupNames); i++ {
|
||||
@@ -173,6 +173,16 @@ func one(ctx context.Context, outd, inf string, patterns []string, overrides Fie
|
||||
}
|
||||
}
|
||||
|
||||
for _, wr := range [][2]*string{
|
||||
[2]*string{&found.Title, &overrides.Title},
|
||||
[2]*string{&found.Season, &overrides.Season},
|
||||
[2]*string{&found.Episode, &overrides.Episode},
|
||||
} {
|
||||
if *wr[1] != "" {
|
||||
*wr[0] = *wr[1]
|
||||
}
|
||||
}
|
||||
|
||||
if found.Title == "" || found.Season == "" || found.Episode == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user