Fix feeds not updating if they dont contain a feedurl

This commit is contained in:
Alex McGrath
2021-02-06 00:17:32 +00:00
committed by Senan Kelly
parent b57860a967
commit 76875de87b
3 changed files with 5 additions and 4 deletions

View File

@@ -70,13 +70,14 @@ func (p *Podcasts) GetPodcastEpisodes(podcastID int) ([]*db.PodcastEpisode, erro
return episodes, nil
}
func (p *Podcasts) AddNewPodcast(feed *gofeed.Feed, userID int) (*db.Podcast, error) {
func (p *Podcasts) AddNewPodcast(rssURL string, feed *gofeed.Feed,
userID int) (*db.Podcast, error) {
podcast := db.Podcast{
Description: feed.Description,
ImageURL: feed.Image.URL,
UserID: userID,
Title: feed.Title,
URL: feed.FeedLink,
URL: rssURL,
}
podPath := podcast.Fullpath(p.PodcastBasePath)
err := os.Mkdir(podPath, 0755)