From d46ef729b08d7d222ca7718d5df506867015cea8 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 13 Nov 2015 15:08:28 +0100 Subject: [PATCH] Hotfix: always use LP.AuthorID to get EP.AuthorID --- gparser/episodeparser.go | 15 +-------------- gparser/feedparser.go | 15 +-------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/gparser/episodeparser.go b/gparser/episodeparser.go index 089fc04..abef63b 100644 --- a/gparser/episodeparser.go +++ b/gparser/episodeparser.go @@ -106,20 +106,7 @@ func ParseEpisode(i int, s *goquery.Selection, bar *pb.ProgressBar) { EP.Descr.String += s.Text() + "\n" }) EP.Descr.String = strings.Trim(EP.Descr.String, "\n ") - au, _ := doc.Find(".author > a.avatar").Attr("href") - au = strings.TrimSuffix(au, "/") - aur, _ := url.Parse(au) - if path.Base(aur.Path) == "" || path.Base(aur.Path) == "." { - log.Printf("ERR EP %s: No author found", slug) - return - } - if path.Base(aur.Path) == "tobinator612" { // Don't ask… just… don't ask - EP.AuthorID = LP.AuthorID - } else { - var AT database.Author - database.Db.Where("slug = ?", path.Base(aur.Path)).First(&AT) - EP.AuthorID = AT.ID - } + EP.AuthorID = LP.AuthorID yt, _ := doc.Find(".youtube > iframe").Attr("src") ytpath, _ := url.Parse(yt) EP.Youtube.String = path.Base(ytpath.Path) diff --git a/gparser/feedparser.go b/gparser/feedparser.go index 8def538..a6ce218 100644 --- a/gparser/feedparser.go +++ b/gparser/feedparser.go @@ -116,20 +116,7 @@ func ParseFeedEpisode(u string, bar *pb.ProgressBar) { EP.Descr.String += s.Text() + "\n" }) EP.Descr.String = strings.Trim(EP.Descr.String, "\n ") - au, _ := doc.Find(".author > a.avatar").Attr("href") - au = strings.TrimSuffix(au, "/") - aur, _ := url.Parse(au) - if path.Base(aur.Path) == "" || path.Base(aur.Path) == "." { - log.Printf("ERR EP %s: No author found", slug) - return - } - if path.Base(aur.Path) == "tobinator612" { // Don't ask… just… don't ask - EP.AuthorID = LP.AuthorID - } else { - var AT database.Author - database.Db.Where("slug = ?", path.Base(aur.Path)).First(&AT) - EP.AuthorID = AT.ID - } + EP.AuthorID = LP.AuthorID yt, _ := doc.Find(".youtube > iframe").Attr("src") ytpath, _ := url.Parse(yt) EP.Youtube.String = path.Base(ytpath.Path)