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