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
|
EventType string
|
||||||
SourcePath string
|
SourcePath string
|
||||||
SourceFolder string
|
SourceFolder string
|
||||||
|
FileName string
|
||||||
InFolder bool
|
InFolder bool
|
||||||
Arr string
|
Arr string
|
||||||
}
|
}
|
||||||
@ -19,8 +20,9 @@ type MediaFiles struct {
|
|||||||
func (m *MediaFiles) IsInFolder() {
|
func (m *MediaFiles) IsInFolder() {
|
||||||
folderList := []string{"Movies", "4K-Movies", "Series", "4K-Series", "Kids", "Animes"}
|
folderList := []string{"Movies", "4K-Movies", "Series", "4K-Series", "Kids", "Animes"}
|
||||||
|
|
||||||
SplitFolder := strings.Split(m.SourceFolder, "/")
|
SplitFolder := strings.Split(m.SourcePath, "/")
|
||||||
LastFolder := SplitFolder[len(SplitFolder)-1]
|
LastFolder := SplitFolder[len(SplitFolder)-2]
|
||||||
|
m.FileName = SplitFolder[len(SplitFolder)-1]
|
||||||
|
|
||||||
log.Printf("Found last folder to be: %v", LastFolder)
|
log.Printf("Found last folder to be: %v", LastFolder)
|
||||||
|
|
||||||
@ -28,10 +30,10 @@ func (m *MediaFiles) IsInFolder() {
|
|||||||
|
|
||||||
if !ContainsFolder {
|
if !ContainsFolder {
|
||||||
m.InFolder = true
|
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 {
|
} else {
|
||||||
m.InFolder = false
|
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