More tweaks
This commit is contained in:
parent
81797f66ca
commit
b6b5814588
18
cmd/main.go
18
cmd/main.go
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/communicator"
|
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/communicator"
|
||||||
@ -39,7 +38,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
libraryType := locator.GetLibraryType(cfg, sectionID)
|
libraryType := locator.GetLibraryType(cfg, sectionID)
|
||||||
fmt.Println(libraryType)
|
|
||||||
|
|
||||||
ids, titles := locator.GetTitles(cfg, sectionID, days)
|
ids, titles := locator.GetTitles(cfg, sectionID, days)
|
||||||
|
|
||||||
@ -51,11 +49,17 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if delete {
|
if delete {
|
||||||
files := eraser.LookupFileLocation(cfg, ids)
|
if libraryType == "movie" {
|
||||||
err = eraser.DeleteMedia(delete, files)
|
files := eraser.LookupFileLocation(cfg, ids)
|
||||||
if err != nil {
|
err = eraser.DeleteMovies(delete, files)
|
||||||
log.Println(err)
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
}
|
||||||
|
// } else if libraryType == "show" {
|
||||||
|
// err = eraser.DeleteTVShows()
|
||||||
|
// if err != nil {
|
||||||
|
// log.Println(err)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,8 @@ func LookupFileLocation(config config.Config, ids []int) []string {
|
|||||||
return fileList
|
return fileList
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteMedia will actually perform the deletion.
|
// DeleteMovies will actually perform the deletion.
|
||||||
func DeleteMedia(delete bool, files []string) error {
|
func DeleteMovies(delete bool, files []string) error {
|
||||||
var err error
|
var err error
|
||||||
if delete {
|
if delete {
|
||||||
for _, i := range files {
|
for _, i := range files {
|
||||||
|
Loading…
Reference in New Issue
Block a user