From 8997e6ae1ace11b29bf51b019acf1520d8b6e6c6 Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Tue, 20 Nov 2018 14:05:51 -0600 Subject: [PATCH] test --- pkg/eraser/eraser.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/eraser/eraser.go b/pkg/eraser/eraser.go index 56c6f33..ece7b99 100644 --- a/pkg/eraser/eraser.go +++ b/pkg/eraser/eraser.go @@ -8,6 +8,7 @@ import ( "net/http" "os" "path/filepath" + "sort" "git.linuxrocker.com/mattburchett/Housekeeper/pkg/config" "git.linuxrocker.com/mattburchett/Housekeeper/pkg/model" @@ -76,7 +77,10 @@ func LookupTVFileLocation(config config.Config, ids []int) []string { plexTV := plexModel.Video for _, i := range plexTV { - fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File))) + count := sort.SearchStrings(fileList, i.Media.Part.File) + if count == 0 { + fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File))) + } } } return fileList