TV Show Fix #6

Merged
mattburchett merged 17 commits from matt/#2 into master 2018-11-20 23:08:30 +00:00
2 changed files with 13 additions and 9 deletions
Showing only changes of commit b6b5814588 - Show all commits

View File

@ -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 {
if libraryType == "movie" {
files := eraser.LookupFileLocation(cfg, ids)
err = eraser.DeleteMedia(delete, files)
err = eraser.DeleteMovies(delete, files)
if err != nil {
log.Println(err)
}
// } else if libraryType == "show" {
// err = eraser.DeleteTVShows()
// if err != nil {
// log.Println(err)
// }
}
}
}

View File

@ -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 {