added feed for single podcast

pull/171/head
Akhil Gupta 3 years ago
parent 8a2f7af9e8
commit 916ce33449

@ -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.09.20</p> <p align="center">Current Version -2021.10.01</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

@ -327,7 +327,7 @@
<td>${ detailPodcast.Author }</td> <td>${ detailPodcast.Author }</td>
</tr> </tr>
<tr> <tr>
<td>Url</td> <td>Original Url</td>
<td> <a target="_blank" :href="detailPodcast.URL">Link</a></td> <td> <a target="_blank" :href="detailPodcast.URL">Link</a></td>
</tr> </tr>
@ -347,6 +347,10 @@
<td>Paused</td> <td>Paused</td>
<td> ${ detailPodcast.IsPaused?'Yes':'No' }</td> <td> ${ detailPodcast.IsPaused?'Yes':'No' }</td>
</tr> </tr>
<tr>
<td>Podgrab Feed</td>
<td> <a target="_blank" :href="'/podcasts/'+detailPodcast.ID+'/rss'">Link</a></td>
</tr>
</table> </table>
</Modal> </Modal>

@ -132,7 +132,7 @@
<table> <table>
<tr> <tr>
<td>Current Version</td> <td>Current Version</td>
<td> 2021.09.20</td> <td> 2021.10.01</td>
</tr> </tr>
<tr> <tr>
<td>Website</td> <td>Website</td>

@ -487,6 +487,28 @@ func createRss(items []db.PodcastItem, title, description string, c *gin.Context
} }
} }
func GetRssForPodcastById(c *gin.Context) {
var searchByIdQuery SearchByIdQuery
if c.ShouldBindUri(&searchByIdQuery) == nil {
var podcast db.Podcast
err:=db.GetPodcastById(searchByIdQuery.Id,&podcast)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid request"})
}
var podIds []string
podIds = append(podIds, searchByIdQuery.Id)
items := *service.GetAllPodcastItemsByPodcastIds(podIds)
description := podcast.Summary
title := podcast.Title
if err == nil {
c.XML(200, createRss(items, title, description, c))
}
} else {
c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid request"})
}
}
func GetRssForTagById(c *gin.Context) { func GetRssForTagById(c *gin.Context) {
var searchByIdQuery SearchByIdQuery var searchByIdQuery SearchByIdQuery
if c.ShouldBindUri(&searchByIdQuery) == nil { if c.ShouldBindUri(&searchByIdQuery) == nil {

@ -159,6 +159,7 @@ func main() {
router.DELETE("/podcasts/:id/podcast", controllers.DeleteOnlyPodcastById) router.DELETE("/podcasts/:id/podcast", controllers.DeleteOnlyPodcastById)
router.GET("/podcasts/:id/pause", controllers.PausePodcastById) router.GET("/podcasts/:id/pause", controllers.PausePodcastById)
router.GET("/podcasts/:id/unpause", controllers.UnpausePodcastById) router.GET("/podcasts/:id/unpause", controllers.UnpausePodcastById)
router.GET("/podcasts/:id/rss", controllers.GetRssForPodcastById)
router.GET("/podcastitems", controllers.GetAllPodcastItems) router.GET("/podcastitems", controllers.GetAllPodcastItems)
router.GET("/podcastitems/:id", controllers.GetPodcastItemById) router.GET("/podcastitems/:id", controllers.GetPodcastItemById)

Loading…
Cancel
Save