Skip to content

Commit

Permalink
use image path from conf
Browse files Browse the repository at this point in the history
fix rebase conflict
  • Loading branch information
Artur committed Apr 2, 2022
1 parent 9a74639 commit 451369b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
7 changes: 3 additions & 4 deletions app/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ func (s *Server) getFeedCtrl(w http.ResponseWriter, r *http.Request) {

rss := feed.Rss2{
Version: "2.0",
NsItunes: "http://www.itunes.com/dtds/podcast-1.0.dtd",
NsMedia: "http://search.yahoo.com/mrss/",
ItemList: items,
Title: s.Conf.Feeds[feedName].Title,
Description: s.Conf.Feeds[feedName].Description,
Expand All @@ -158,6 +156,7 @@ func (s *Server) getFeedCtrl(w http.ResponseWriter, r *http.Request) {
PubDate: items[0].PubDate,
LastBuildDate: time.Now().Format(time.RFC822Z),
NsItunes: "http://www.itunes.com/dtds/podcast-1.0.dtd",
NsMedia: "http://search.yahoo.com/mrss/",
}

// replace link to UI page
Expand All @@ -166,10 +165,10 @@ func (s *Server) getFeedCtrl(w http.ResponseWriter, r *http.Request) {
rss.Link = baseURL + "/feed/" + feedName
if s.Conf.Feeds[feedName].Image != "" {
rss.ItunesImage = feed.ItunesImg{
URL: baseURL + "/image/" + feedName,
URL: baseURL + s.Conf.Feeds[feedName].Image,
}
rss.MediaThumbnail = feed.MediaThumbnail{
URL: baseURL + "/image/" + feedName,
URL: baseURL + s.Conf.Feeds[feedName].Image,
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions app/feed/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import (

// Rss2 feed
type Rss2 struct {
XMLName xml.Name `xml:"rss"`
Version string `xml:"version,attr"`
NsItunes string `xml:"xmlns:itunes,attr"`
NsMedia string `xml:"xmlns:media,attr"`
Title string `xml:"channel>title"`
Language string `xml:"channel>language"`
Link string `xml:"channel>link"`
Description string `xml:"channel>description"`
PubDate string `xml:"channel>pubDate"`
LastBuildDate string `xml:"channel>lastBuildDate"`
XMLName xml.Name `xml:"rss"`
Version string `xml:"version,attr"`
NsItunes string `xml:"xmlns:itunes,attr"`
NsMedia string `xml:"xmlns:media,attr"`
Title string `xml:"channel>title"`
Language string `xml:"channel>language"`
Link string `xml:"channel>link"`
Description string `xml:"channel>description"`
PubDate string `xml:"channel>pubDate"`
LastBuildDate string `xml:"channel>lastBuildDate"`
ItunesImage ItunesImg `xml:"channel>itunes:image"`
MediaThumbnail MediaThumbnail `xml:"channel>media:thumbnail"`

Expand Down

0 comments on commit 451369b

Please sign in to comment.