|
|
@ -532,6 +532,7 @@ func DownloadMissingEpisodes() error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func CheckMissingFiles() error {
|
|
|
|
func CheckMissingFiles() error {
|
|
|
|
data, err := db.GetAllPodcastItemsAlreadyDownloaded()
|
|
|
|
data, err := db.GetAllPodcastItemsAlreadyDownloaded()
|
|
|
|
|
|
|
|
setting := db.GetOrCreateSetting()
|
|
|
|
|
|
|
|
|
|
|
|
//fmt.Println("Processing episodes: ", strconv.Itoa(len(*data)))
|
|
|
|
//fmt.Println("Processing episodes: ", strconv.Itoa(len(*data)))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -540,7 +541,11 @@ func CheckMissingFiles() error {
|
|
|
|
for _, item := range *data {
|
|
|
|
for _, item := range *data {
|
|
|
|
fileExists := FileExists(item.DownloadPath)
|
|
|
|
fileExists := FileExists(item.DownloadPath)
|
|
|
|
if !fileExists {
|
|
|
|
if !fileExists {
|
|
|
|
SetPodcastItemAsNotDownloaded(item.ID, db.NotDownloaded)
|
|
|
|
if setting.DontDownloadDeletedFromDisk {
|
|
|
|
|
|
|
|
SetPodcastItemAsNotDownloaded(item.ID, db.Deleted)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
SetPodcastItemAsNotDownloaded(item.ID, db.NotDownloaded)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
@ -736,7 +741,7 @@ func GetSearchFromPodcastIndex(pod *podcastindex.Podcast) *model.CommonSearchRes
|
|
|
|
return p
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func UpdateSettings(downloadOnAdd bool, initialDownloadCount int, autoDownload bool, appendDateToFileName bool, appendEpisodeNumberToFileName bool, darkMode bool, downloadEpisodeImages bool, generateNFOFile bool) error {
|
|
|
|
func UpdateSettings(downloadOnAdd bool, initialDownloadCount int, autoDownload bool, appendDateToFileName bool, appendEpisodeNumberToFileName bool, darkMode bool, downloadEpisodeImages bool, generateNFOFile bool, dontDownloadDeletedFromDisk bool) error {
|
|
|
|
setting := db.GetOrCreateSetting()
|
|
|
|
setting := db.GetOrCreateSetting()
|
|
|
|
|
|
|
|
|
|
|
|
setting.AutoDownload = autoDownload
|
|
|
|
setting.AutoDownload = autoDownload
|
|
|
@ -747,6 +752,7 @@ func UpdateSettings(downloadOnAdd bool, initialDownloadCount int, autoDownload b
|
|
|
|
setting.DarkMode = darkMode
|
|
|
|
setting.DarkMode = darkMode
|
|
|
|
setting.DownloadEpisodeImages = downloadEpisodeImages
|
|
|
|
setting.DownloadEpisodeImages = downloadEpisodeImages
|
|
|
|
setting.GenerateNFOFile = generateNFOFile
|
|
|
|
setting.GenerateNFOFile = generateNFOFile
|
|
|
|
|
|
|
|
setting.DontDownloadDeletedFromDisk = dontDownloadDeletedFromDisk
|
|
|
|
|
|
|
|
|
|
|
|
return db.UpdateSettings(setting)
|
|
|
|
return db.UpdateSettings(setting)
|
|
|
|
}
|
|
|
|
}
|
|
|
|