update
This commit is contained in:
parent
b2b125114c
commit
bd24a5e91a
61
DeleteArr.go
61
DeleteArr.go
@ -3,9 +3,36 @@ package main
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type RadarrMovie struct {
|
||||
EventType string
|
||||
SourcePath string
|
||||
SourceFolder string
|
||||
InFolder bool
|
||||
}
|
||||
|
||||
type SonarrSerie struct {
|
||||
SourcePath string
|
||||
SourceFolder string
|
||||
InFolder bool
|
||||
SeasonFolder bool
|
||||
}
|
||||
|
||||
func (r *RadarrMovie) IsInFolder() {
|
||||
folderList := []string{"Movies", "4K-Movies"}
|
||||
dir, _ := path.Split(r.SourceFolder)
|
||||
|
||||
for _, p := range folderList {
|
||||
if p == dir {
|
||||
r.InFolder = true
|
||||
log.Printf("Movie %v is in a Folder\n", r.SourceFolder)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
ex, err := os.Executable()
|
||||
@ -22,12 +49,30 @@ func main() {
|
||||
|
||||
log.SetOutput(f)
|
||||
|
||||
EventType := os.Getenv("radarr_eventtype")
|
||||
log.Println(EventType)
|
||||
Event := os.Getenv("EventType")
|
||||
log.Println(Event)
|
||||
SourcePath := os.Getenv("radarr_moviefile_sourcepath")
|
||||
log.Println(SourcePath)
|
||||
SourceFolder := os.Getenv("radarr_moviefile_sourcefolder")
|
||||
log.Println(SourceFolder)
|
||||
RadarrEventType := os.Getenv("radarr_eventtype")
|
||||
SonarrEventType := os.Getenv("sonarr_eventtype")
|
||||
|
||||
if RadarrEventType != "" {
|
||||
r := &RadarrMovie{}
|
||||
r.EventType = os.Getenv("radarr_eventtype")
|
||||
r.SourcePath = os.Getenv("radarr_moviefile_sourcepath")
|
||||
log.Println(r.SourcePath)
|
||||
r.SourceFolder = os.Getenv("radarr_moviefile_sourcefolder")
|
||||
log.Println(r.SourceFolder)
|
||||
|
||||
r.IsInFolder()
|
||||
|
||||
if r.InFolder {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if SonarrEventType != "" {
|
||||
s := &SonarrSerie{}
|
||||
s.SourcePath = os.Getenv("sonarr_episodefile_sourcepath")
|
||||
log.Println(s.SourcePath)
|
||||
s.SourceFolder = os.Getenv("radarr_moviefile_sourcefolder")
|
||||
log.Println(s.SourceFolder)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user