Tweaks #9
10
cmd/main.go
10
cmd/main.go
@ -56,13 +56,13 @@ func main() {
|
|||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
} else if libraryType == "show" {
|
} else if libraryType == "show" {
|
||||||
files := eraser.LookupTVFileLocation(cfg, ids)
|
// files := eraser.LookupTVFileLocation(cfg, ids)
|
||||||
sonarrIDs := locator.GetSonarrIDs(cfg, titles)
|
sonarrIDs := locator.GetSonarrIDs(cfg, titles)
|
||||||
eraser.DeleteSeriesFromSonarr(cfg, sonarrIDs)
|
eraser.DeleteSeriesFromSonarr(cfg, sonarrIDs)
|
||||||
err = eraser.DeleteFiles(delete, files)
|
// err = eraser.DeleteFiles(delete, files)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
log.Println(err)
|
// log.Println(err)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/config"
|
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/config"
|
||||||
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/model"
|
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/model"
|
||||||
@ -80,7 +79,7 @@ func LookupTVFileLocation(config config.Config, ids []int) []string {
|
|||||||
plexTV := plexModel.Video
|
plexTV := plexModel.Video
|
||||||
|
|
||||||
for _, i := range plexTV {
|
for _, i := range plexTV {
|
||||||
fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File)))
|
fileList = append(fileList, filepath.Dir(i.Media.Part.File))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, r := range fileList {
|
for _, r := range fileList {
|
||||||
@ -121,9 +120,9 @@ func DeleteSeriesFromSonarr(config config.Config, ids []int) {
|
|||||||
log.Fatal(jsonErr)
|
log.Fatal(jsonErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains("does not exist", deleteModel.Message) {
|
// if strings.Contains("does not exist", deleteModel.Message) {
|
||||||
log.Printf("The following ID does not exist: %v", i)
|
// log.Printf("The following ID does not exist: %v", i)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user