unsset audio/image if present in the content

This commit is contained in:
Nazar Kanaev
2021-04-04 21:31:25 +01:00
parent 0828d6782e
commit 63ad971890
4 changed files with 91 additions and 3 deletions

View File

@@ -77,11 +77,9 @@ func ParseRSS(r io.Reader) (*Feed, error) {
if e.Type == "audio/mpeg" || e.Type == "audio/x-m4a" {
podcastURL = e.URL
origBase := path.Base(srcitem.OrigEnclosureLink)
if origBase != "" && strings.Contains(podcastURL, origBase) {
if srcitem.OrigEnclosureLink != "" && strings.Contains(podcastURL, path.Base(srcitem.OrigEnclosureLink)) {
podcastURL = srcitem.OrigEnclosureLink
}
break
}
}