streamline file download

pull/91/head
Akhil Gupta 4 years ago
parent 3b8cf69abe
commit ceea6f3f0b

@ -131,7 +131,7 @@
{{if .DownloadPath}}
<a
class="button"
href="{{ removeStartingSlash .DownloadPath }}"
href="/podcastitems/{{.ID}}/file"
download
title="Download episode file"
><i class="fas fa-download"></i

@ -185,7 +185,7 @@
<a
v-if="item.DownloadPath"
class="button"
:href="removeStartingSlash(item.DownloadPath)"
:href="downloadFromServer(item)"
download
title="Download episode file"
><i class="fas fa-download"></i
@ -422,6 +422,9 @@ var app = new Vue({
getEpisodeImage(item){
return "/podcastitems/"+item.ID+"/image"
},
downloadFromServer(item){
return "/podcastitems/"+item.ID+"/file"
},
changePlayedStatus(item){
changePlayedStatus(item.ID,!item.IsPlayed,()=>item.IsPlayed=!item.IsPlayed)
},

@ -241,7 +241,7 @@ func GetPodcastItemFileById(c *gin.Context) {
c.Header("Content-Type", "application/octet-stream")
c.File(podcast.DownloadPath)
} else {
c.Redirect(302, fmt.Sprintf("/%s", podcast.FileURL))
c.Redirect(302, podcast.FileURL)
}
}
} else {

Loading…
Cancel
Save