t
This commit is contained in:
parent
399ab03a21
commit
b09c54efd7
10
DeleteArr.go
10
DeleteArr.go
@ -12,6 +12,7 @@ type MediaFiles struct {
|
||||
EventType string
|
||||
SourcePath string
|
||||
SourceFolder string
|
||||
FileName string
|
||||
InFolder bool
|
||||
Arr string
|
||||
}
|
||||
@ -19,8 +20,9 @@ type MediaFiles struct {
|
||||
func (m *MediaFiles) IsInFolder() {
|
||||
folderList := []string{"Movies", "4K-Movies", "Series", "4K-Series", "Kids", "Animes"}
|
||||
|
||||
SplitFolder := strings.Split(m.SourceFolder, "/")
|
||||
LastFolder := SplitFolder[len(SplitFolder)-1]
|
||||
SplitFolder := strings.Split(m.SourcePath, "/")
|
||||
LastFolder := SplitFolder[len(SplitFolder)-2]
|
||||
m.FileName = SplitFolder[len(SplitFolder)-1]
|
||||
|
||||
log.Printf("Found last folder to be: %v", LastFolder)
|
||||
|
||||
@ -28,10 +30,10 @@ func (m *MediaFiles) IsInFolder() {
|
||||
|
||||
if !ContainsFolder {
|
||||
m.InFolder = true
|
||||
log.Printf("Movie %v is in a Folder\n", m.SourceFolder)
|
||||
log.Printf("Movie %v is in a Folder\n", m.FileName)
|
||||
} else {
|
||||
m.InFolder = false
|
||||
log.Printf("Movie %v is not in a Folder\n", m.SourceFolder)
|
||||
log.Printf("Movie %v is not in a Folder\n", m.FileName)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user