update
This commit is contained in:
parent
44c84f0dc3
commit
6c7e6ac06e
18
DeleteArr.go
18
DeleteArr.go
@ -5,6 +5,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RadarrMovie struct {
|
type RadarrMovie struct {
|
||||||
@ -25,15 +26,14 @@ func (r *RadarrMovie) IsInFolder() {
|
|||||||
folderList := []string{"Movies", "4K-Movies"}
|
folderList := []string{"Movies", "4K-Movies"}
|
||||||
dir, _ := path.Split(r.SourceFolder)
|
dir, _ := path.Split(r.SourceFolder)
|
||||||
|
|
||||||
for _, p := range folderList {
|
ContainsFolder := slices.Contains(folderList, dir)
|
||||||
log.Println(p)
|
|
||||||
if p == dir {
|
if ContainsFolder {
|
||||||
r.InFolder = true
|
r.InFolder = true
|
||||||
log.Printf("Movie %v is in a Folder\n", r.SourceFolder)
|
log.Printf("Movie %v is in a Folder\n", r.SourceFolder)
|
||||||
} else {
|
} else {
|
||||||
r.InFolder = false
|
r.InFolder = false
|
||||||
log.Printf("Movie %v is not in a Folder\n", r.SourceFolder)
|
log.Printf("Movie %v is not in a Folder\n", r.SourceFolder)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user