From b6b5814588d8ea1cb6ffa3af7e18302db5f4672c Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Tue, 20 Nov 2018 13:39:15 -0600 Subject: [PATCH] More tweaks --- cmd/main.go | 18 +++++++++++------- pkg/eraser/eraser.go | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index d046b6f..ba5923d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -2,7 +2,6 @@ package main import ( "flag" - "fmt" "log" "git.linuxrocker.com/mattburchett/Housekeeper/pkg/communicator" @@ -39,7 +38,6 @@ func main() { } libraryType := locator.GetLibraryType(cfg, sectionID) - fmt.Println(libraryType) ids, titles := locator.GetTitles(cfg, sectionID, days) @@ -51,11 +49,17 @@ func main() { } if delete { - files := eraser.LookupFileLocation(cfg, ids) - err = eraser.DeleteMedia(delete, files) - if err != nil { - log.Println(err) + if libraryType == "movie" { + files := eraser.LookupFileLocation(cfg, ids) + err = eraser.DeleteMovies(delete, files) + if err != nil { + log.Println(err) + } + // } else if libraryType == "show" { + // err = eraser.DeleteTVShows() + // if err != nil { + // log.Println(err) + // } } } - } diff --git a/pkg/eraser/eraser.go b/pkg/eraser/eraser.go index bc3e160..0209faf 100644 --- a/pkg/eraser/eraser.go +++ b/pkg/eraser/eraser.go @@ -45,8 +45,8 @@ func LookupFileLocation(config config.Config, ids []int) []string { return fileList } -// DeleteMedia will actually perform the deletion. -func DeleteMedia(delete bool, files []string) error { +// DeleteMovies will actually perform the deletion. +func DeleteMovies(delete bool, files []string) error { var err error if delete { for _, i := range files {