This commit is contained in:
Gregory Salaun 2023-12-18 08:53:22 +07:00
parent 1736904539
commit 42aad9a4f3

View File

@ -90,9 +90,9 @@ func (m *MediaFiles) IsInFolder(cfg *Config) {
func main() {
os.Setenv("radarr_moviefile_sourcepath", "/mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW.mkv")
os.Setenv("radarr_moviefile_sourcefolder", "/mnt/Multimedia/Download/PostProcess/Movies")
os.Setenv("radarr_eventtype", "Download")
// os.Setenv("radarr_moviefile_sourcepath", "/mnt/Multimedia/Download/PostProcess/Movies/Butchers.Crossing.2023.MULTi.1080p.WEB.x264-FW.mkv")
// os.Setenv("radarr_moviefile_sourcefolder", "/mnt/Multimedia/Download/PostProcess/Movies")
// os.Setenv("radarr_eventtype", "Download")
// os.Setenv("EventType", "Test")
if os.Getenv("radarr_eventtype") == "Test" || os.Getenv("sonarr_eventtype") == "Test" {
@ -168,7 +168,7 @@ func main() {
mkvCount += 1
} else {
os.Remove(m.SourceFolder + "/" + v.Name())
log.Printf("Deleting file non MKV file: %v", m.SourceFolder+"/"+v.Name())
log.Printf("Deleting non MKV file: %v", m.SourceFolder+"/"+v.Name())
}
}
@ -176,7 +176,7 @@ func main() {
log.Printf("Found %v MKV files in the folder, deleting only %v", mkvCount, m.SourcePath)
os.Remove(m.SourcePath)
} else {
log.Printf("Found only one MKV files in the folder, deleting thoe folder %v", m.SourceFolder)
log.Printf("Found only one MKV files in the folder, deleting the folder %v", m.SourceFolder)
os.RemoveAll(m.SourceFolder)
}