Group all unplayable torrents in a separate directory
This commit is contained in:
@@ -13,7 +13,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ALL_TORRENTS = "__all__"
|
||||
ALL_TORRENTS = "__all__"
|
||||
UNPLAYABLE_TORRENTS = "__unplayable__"
|
||||
)
|
||||
|
||||
func loadV1Config(content []byte, log *logutil.Logger) (*ZurgConfigV1, error) {
|
||||
@@ -30,13 +31,14 @@ func (z *ZurgConfigV1) GetVersion() string {
|
||||
}
|
||||
|
||||
func (z *ZurgConfigV1) GetDirectories() []string {
|
||||
rootDirectories := make([]string, len(z.Directories)+1)
|
||||
rootDirectories := make([]string, len(z.Directories)+2)
|
||||
i := 0
|
||||
for directory := range z.Directories {
|
||||
rootDirectories[i] = directory
|
||||
i++
|
||||
}
|
||||
rootDirectories[i] = ALL_TORRENTS
|
||||
rootDirectories[i+1] = UNPLAYABLE_TORRENTS
|
||||
return rootDirectories
|
||||
}
|
||||
|
||||
@@ -74,6 +76,7 @@ func (z *ZurgConfigV1) GetGroupMap() map[string][]string {
|
||||
temp := make([]string, len(v))
|
||||
copy(temp, v)
|
||||
result[k] = temp
|
||||
// result[k] = append(result[k], UNPLAYABLE_TORRENTS)
|
||||
}
|
||||
result[ALL_TORRENTS] = []string{ALL_TORRENTS} // Add special group for all torrents
|
||||
|
||||
|
||||
Reference in New Issue
Block a user