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() { 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_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_moviefile_sourcefolder", "/mnt/Multimedia/Download/PostProcess/Movies")
os.Setenv("radarr_eventtype", "Download") // os.Setenv("radarr_eventtype", "Download")
// os.Setenv("EventType", "Test") // os.Setenv("EventType", "Test")
if os.Getenv("radarr_eventtype") == "Test" || os.Getenv("sonarr_eventtype") == "Test" { if os.Getenv("radarr_eventtype") == "Test" || os.Getenv("sonarr_eventtype") == "Test" {
@ -168,7 +168,7 @@ func main() {
mkvCount += 1 mkvCount += 1
} else { } else {
os.Remove(m.SourceFolder + "/" + v.Name()) 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) log.Printf("Found %v MKV files in the folder, deleting only %v", mkvCount, m.SourcePath)
os.Remove(m.SourcePath) os.Remove(m.SourcePath)
} else { } 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) os.RemoveAll(m.SourceFolder)
} }