fix breaking backups & possibly breaking download

pull/142/head
Akhil Gupta 3 years ago
parent c9959e7335
commit bd559a88e6

@ -14,7 +14,7 @@
</a> --> </a> -->
<h1 align="center" style="margin-bottom:0px">Podgrab</h1> <h1 align="center" style="margin-bottom:0px">Podgrab</h1>
<p align="center">Current Version - 2021.06.20</p> <p align="center">Current Version - 2021.06.30</p>
<p align="center"> <p align="center">
A self-hosted podcast manager to download episodes as soon as they become live A self-hosted podcast manager to download episodes as soon as they become live

@ -124,7 +124,7 @@
<table> <table>
<tr> <tr>
<td>Current Version</td> <td>Current Version</td>
<td> 2021.06.20</td> <td> 2021.06.30</td>
</tr> </tr>
<tr> <tr>
<td>Website</td> <td>Website</td>

@ -5,6 +5,7 @@ import (
"html/template" "html/template"
"log" "log"
"os" "os"
"path"
"strconv" "strconv"
"time" "time"
@ -142,8 +143,11 @@ func main() {
} }
dataPath := os.Getenv("DATA") dataPath := os.Getenv("DATA")
backupPath := path.Join(os.Getenv("CONFIG"), "backups")
router.Static("/webassets", "./webassets") router.Static("/webassets", "./webassets")
router.Static("/assets", dataPath) router.Static("/assets", dataPath)
router.Static(backupPath, backupPath)
router.POST("/podcasts", controllers.AddPodcast) router.POST("/podcasts", controllers.AddPodcast)
router.GET("/podcasts", controllers.GetAllPodcasts) router.GET("/podcasts", controllers.GetAllPodcasts)
router.GET("/podcasts/:id", controllers.GetPodcastById) router.GET("/podcasts/:id", controllers.GetPodcastById)

@ -295,11 +295,15 @@ func AddPodcastItems(podcast *db.Podcast, newPodcast bool) error {
var downloadStatus db.DownloadStatus var downloadStatus db.DownloadStatus
if setting.AutoDownload { if setting.AutoDownload {
if !newPodcast {
downloadStatus = db.NotDownloaded
} else {
if i < limit { if i < limit {
downloadStatus = db.NotDownloaded downloadStatus = db.NotDownloaded
} else { } else {
downloadStatus = db.Deleted downloadStatus = db.Deleted
} }
}
} else { } else {
downloadStatus = db.Deleted downloadStatus = db.Deleted
} }

Loading…
Cancel
Save