TV Show Fix #6

Merged
mattburchett merged 17 commits from matt/#2 into master 2018-11-20 23:08:30 +00:00
Showing only changes of commit 8997e6ae1a - Show all commits

View File

@ -8,6 +8,7 @@ import (
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"sort"
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/config" "git.linuxrocker.com/mattburchett/Housekeeper/pkg/config"
"git.linuxrocker.com/mattburchett/Housekeeper/pkg/model" "git.linuxrocker.com/mattburchett/Housekeeper/pkg/model"
@ -76,9 +77,12 @@ func LookupTVFileLocation(config config.Config, ids []int) []string {
plexTV := plexModel.Video plexTV := plexModel.Video
for _, i := range plexTV { for _, i := range plexTV {
count := sort.SearchStrings(fileList, i.Media.Part.File)
if count == 0 {
fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File))) fileList = append(fileList, filepath.Dir(filepath.Dir(i.Media.Part.File)))
} }
} }
}
return fileList return fileList
} }