From fd6ce9cabcb48d9fef520fe16f418c89a392e5a1 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Mon, 11 Jan 2021 12:40:15 +0530 Subject: [PATCH] Fix breaking timestamp for Dan Carlin podcast --- service/podcastService.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service/podcastService.go b/service/podcastService.go index a4e3729..400c397 100644 --- a/service/podcastService.go +++ b/service/podcastService.go @@ -143,6 +143,12 @@ func AddPodcastItems(podcast *db.Podcast) error { if (pubDate == time.Time{}) { pubDate, _ = time.Parse(time.RFC1123, obj.PubDate) } + if (pubDate == time.Time{}) { + // RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" + modifiedRFC1123 := "Mon, 2 Jan 2006 15:04:05 MST" + pubDate, _ = time.Parse(modifiedRFC1123, obj.PubDate) + } + var downloadStatus db.DownloadStatus if i < limit { downloadStatus = db.NotDownloaded