From e07e1a25b26d3fd2b8fd097491d055fe7b002d2b Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Mon, 8 Jul 2024 19:01:53 +0300 Subject: небольшие улучшения парсинга описания/комментариев MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wrapper.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'app/wrapper.go') diff --git a/app/wrapper.go b/app/wrapper.go index 0a3d0a7..0340aed 100644 --- a/app/wrapper.go +++ b/app/wrapper.go @@ -127,7 +127,7 @@ func (s skunkyart) GRUser() { case "cover_deviation": group.About.BGMeta = x.ModuleData.CoverDeviation.Deviation group.About.BGMeta.Url = s.ConvertDeviantArtUrlToSkunkyArt(group.About.BGMeta.Url) - group.About.BG = s.ParseMedia(group.About.BGMeta.Media) + group.About.BG = ParseMedia(group.About.BGMeta.Media) case "group_admins": var htm strings.Builder for _, z := range x.ModuleData.GroupAdmins.Results { @@ -165,7 +165,7 @@ func (s skunkyart) GRUser() { folders.WriteString(`
`) @@ -212,10 +212,14 @@ func (s skunkyart) Deviation(author, postname string) { id := id_search[len(id_search)-1] post.Post = devianter.DeviationFunc(id, author) - post.Post.Description = ParseDescription(post.Post.Deviation.TextContent) + if post.Post.Deviation.TextContent.Excerpt != "" { + post.Post.Description = ParseDescription(post.Post.Deviation.TextContent) + } else { + post.Post.Description = ParseDescription(post.Post.Deviation.Extended.DescriptionText) + } // время публикации post.StringTime = post.Post.Deviation.PublishedTime.UTC().String() - post.Post.IMG = s.ParseMedia(post.Post.Deviation.Media) + post.Post.IMG = ParseMedia(post.Post.Deviation.Media) for _, x := range post.Post.Deviation.Extended.RelatedContent { if len(x.Deviations) != 0 { post.Related = s.DeviationList(x.Deviations) -- cgit v1.2.3