diff options
| author | lost+skunk <[email protected]> | 2024-07-08 19:01:53 +0300 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-07-08 19:01:53 +0300 |
| commit | e07e1a25b26d3fd2b8fd097491d055fe7b002d2b (patch) | |
| tree | 55fd58bcf7c3ebde1a1a5af1c4207434ed191741 /app/wrapper.go | |
| parent | 99fe9cf9644ed1896bd90f66cf6a12251587d07c (diff) | |
| download | skunky-art-e07e1a25b26d3fd2b8fd097491d055fe7b002d2b.tar.gz skunky-art-e07e1a25b26d3fd2b8fd097491d055fe7b002d2b.tar.bz2 skunky-art-e07e1a25b26d3fd2b8fd097491d055fe7b002d2b.zip | |
небольшие улучшения парсинга описания/комментариев
Diffstat (limited to 'app/wrapper.go')
| -rw-r--r-- | app/wrapper.go | 12 |
1 files changed, 8 insertions, 4 deletions
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(`<a href="`) folders.WriteString(s.ConvertDeviantArtUrlToSkunkyArt(x.Thumb.Url)) folders.WriteString(`"><img loading="lazy" src="`) - folders.WriteString(s.ParseMedia(x.Thumb.Media)) + folders.WriteString(ParseMedia(x.Thumb.Media)) folders.WriteString(`" title="`) folders.WriteString(x.Thumb.Title) folders.WriteString(`"></a><br>`) @@ -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) |
