Hotfix
This commit is contained in:
@@ -12,6 +12,10 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
const (
|
||||
ALL_TORRENTS = "__all__"
|
||||
)
|
||||
|
||||
func loadV1Config(content []byte, log *zap.SugaredLogger) (*ZurgConfigV1, error) {
|
||||
var configV1 ZurgConfigV1
|
||||
if err := yaml.Unmarshal(content, &configV1); err != nil {
|
||||
@@ -26,12 +30,13 @@ func (z *ZurgConfigV1) GetVersion() string {
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) GetDirectories() []string {
|
||||
rootDirectories := make([]string, len(z.Directories))
|
||||
rootDirectories := make([]string, len(z.Directories)+1)
|
||||
i := 0
|
||||
for directory := range z.Directories {
|
||||
rootDirectories[i] = directory
|
||||
i++
|
||||
}
|
||||
rootDirectories[i] = ALL_TORRENTS
|
||||
return rootDirectories
|
||||
}
|
||||
|
||||
@@ -63,11 +68,15 @@ func (z *ZurgConfigV1) GetGroupMap() map[string][]string {
|
||||
copy(temp, v)
|
||||
result[k] = temp
|
||||
}
|
||||
result[ALL_TORRENTS] = []string{ALL_TORRENTS} // Add special group for all torrents
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) MeetsConditions(directory, torrentName string, torrentIDs, fileNames []string) bool {
|
||||
if directory == ALL_TORRENTS {
|
||||
return true
|
||||
}
|
||||
if _, ok := z.Directories[directory]; !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user