Fix not adding new torrents

This commit is contained in:
lordwelch 2018-01-21 10:10:33 -07:00
parent 7be6edcc45
commit ea1b39f4b7

View File

@ -128,6 +128,11 @@ func download() {
for _, s := range CurrentTorrents {
for _, se := range s {
for _, ep := range se {
_, err = os.Open(filepath.Join(args.PATH, filepath.Base(ep.Ep[0].Meta.FilePath)))
if os.IsNotExist(err) {
os.Symlink(ep.Ep[0].Meta.FilePath, filepath.Join(args.PATH, filepath.Base(ep.Ep[0].Meta.FilePath)))
fmt.Printf("File found for: %s S%sE%s\n", ep.Ep[0].Title, ep.Ep[0].Season, ep.Ep[0].Episode)
}
CurrentHashes = append(CurrentHashes, ep.Ep[0].Meta.Hash)
}
}