From 2a5ba05444b9e1474561289961c234d01ed12463 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Wed, 2 Jun 2021 17:03:13 +0530 Subject: [PATCH] fix breaking slashes and show summary on player --- client/player.html | 5 +++++ internal/sanitize/sanitize.go | 2 ++ service/podcastService.go | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/player.html b/client/player.html index d3e6482..27f8329 100644 --- a/client/player.html +++ b/client/player.html @@ -739,6 +739,10 @@ div#large-visualization{ +
+
+ +
@@ -877,6 +881,7 @@ div#large-visualization{ url:"/podcastitems/"+x.ID+"/file", cover_art_url:image, artist:x.Podcast.Title, + summary:x.Summary, album: new Date(x.PubDate.substr(0,10)).toDateString() } if(!toReturn.url){ diff --git a/internal/sanitize/sanitize.go b/internal/sanitize/sanitize.go index 8854722..9426d9e 100644 --- a/internal/sanitize/sanitize.go +++ b/internal/sanitize/sanitize.go @@ -187,6 +187,8 @@ var illegalName = regexp.MustCompile(`[^[:alnum:]-.]`) func Name(s string) string { // Start with lowercase string fileName := s + fileName = baseNameSeparators.ReplaceAllString(fileName, "-") + fileName = path.Clean(path.Base(fileName)) // Remove illegal characters for names, replacing some common separators with - diff --git a/service/podcastService.go b/service/podcastService.go index f8f8395..cad935d 100644 --- a/service/podcastService.go +++ b/service/podcastService.go @@ -202,7 +202,7 @@ func AddPodcast(url string) (db.Podcast, error) { if errors.Is(err, gorm.ErrRecordNotFound) { data, body, err := FetchURL(url) if err != nil { - fmt.Println("Error") + fmt.Println(err.Error()) Logger.Errorw("Error adding podcast", err) return db.Podcast{}, err }