t
This commit is contained in:
parent
e571c71bc2
commit
d2bc5ed773
12
DeleteArr.go
12
DeleteArr.go
@ -12,24 +12,26 @@ type RadarrMovie struct {
|
|||||||
EventType string
|
EventType string
|
||||||
SourcePath string
|
SourcePath string
|
||||||
SourceFolder string
|
SourceFolder string
|
||||||
|
FileName string
|
||||||
InFolder bool
|
InFolder bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type SonarrSerie struct {
|
type SonarrSerie struct {
|
||||||
SourcePath string
|
SourcePath string
|
||||||
SourceFolder string
|
SourceFolder string
|
||||||
|
FileName string
|
||||||
InFolder bool
|
InFolder bool
|
||||||
SeasonFolder bool
|
SeasonFolder bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RadarrMovie) IsInFolder() {
|
func (r *RadarrMovie) IsInFolder() {
|
||||||
folderList := []string{"Movies", "4K-Movies"}
|
folderList := []string{"Movies", "4K-Movies"}
|
||||||
dir, _ := path.Split(r.SourcePath)
|
dir, f := path.Split(r.SourcePath)
|
||||||
log.Println("dir SourceFolder: " + dir)
|
r.FileName = f
|
||||||
|
|
||||||
ContainsFolder := slices.Contains(folderList, dir)
|
ContainsFolder := slices.Contains(folderList, dir)
|
||||||
|
|
||||||
if ContainsFolder {
|
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 {
|
||||||
@ -40,6 +42,10 @@ func (r *RadarrMovie) IsInFolder() {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
os.Setenv("radarr_moviefile_sourcepath", "/mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW.mkv")
|
||||||
|
os.Setenv("radarr_moviefile_sourcefolder", "/mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW")
|
||||||
|
os.Setenv("radarr_eventtype", "Download")
|
||||||
|
|
||||||
ex, err := os.Executable()
|
ex, err := os.Executable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
7
log.txt
7
log.txt
@ -1,3 +1,10 @@
|
|||||||
2023/12/17 15:03:59
|
2023/12/17 15:03:59
|
||||||
2023/12/17 15:03:59
|
2023/12/17 15:03:59
|
||||||
2023/12/17 15:03:59
|
2023/12/17 15:03:59
|
||||||
|
2023/12/17 17:09:02 /mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW.mkv
|
||||||
|
2023/12/17 17:09:04 radarr_moviefile_sourcefolder
|
||||||
|
2023/12/17 17:09:53 dir SourceFolder: /mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW/
|
||||||
|
2023/12/17 17:10:32 /mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW.mkv
|
||||||
|
2023/12/17 17:10:33 /mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW
|
||||||
|
2023/12/17 17:10:33 dir SourceFolder: /mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW/
|
||||||
|
2023/12/17 17:10:33 Movie /mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW is in a Folder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user