From 0a8b11e1545fc17a491932d0ed425ec0c14a6202 Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Tue, 20 Nov 2018 14:28:37 -0600 Subject: [PATCH] test --- pkg/eraser/eraser.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/eraser/eraser.go b/pkg/eraser/eraser.go index c539304..e4d77c5 100644 --- a/pkg/eraser/eraser.go +++ b/pkg/eraser/eraser.go @@ -75,12 +75,16 @@ func LookupTVFileLocation(config config.Config, ids []int) []string { xml.Unmarshal(body, &plexModel) plexTV := plexModel.Video + results := make([]string, 0) for _, i := range plexTV { - f := i.Media.Part.File - if _, ok := m[f]; !ok { - m[f] = true - fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File))) + fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File))) + } + + for _, r := range fileList { + if _, ok := m[r]; !ok { + m[r] = true + results = append(results, r) } }