Add some artwork-related attributes

This commit is contained in:
VnPower
2024-01-30 21:18:56 +07:00
parent c5fe60261a
commit 8c03c79085
4 changed files with 20 additions and 3 deletions
+2
View File
@@ -103,6 +103,8 @@ type Illust struct {
SanityLevel int `json:"sl"`
XRestrict xRestrict `json:"xRestrict"`
AiType aiType `json:"aiType"`
Bookmarked any `json:"bookmarkData"`
Liked any `json:"json:"likeData"`
User UserBrief
RecentWorks []ArtworkBrief
RelatedWorks []ArtworkBrief
+1
View File
@@ -19,6 +19,7 @@ type ArtworkBrief struct {
Pages int `json:"pageCount"`
XRestrict int `json:"xRestrict"`
AiType int `json:"aiType"`
Bookmarked any `json:"bookmarkData"`
}
func ProxyImages(s, proxy string) string {
+3 -3
View File
@@ -141,9 +141,9 @@ func main() {
self.Get("/", pages.LoginUserPage)
self.Get("/followingWorks", pages.FollowingWorksPage)
self.Get("/bookmarks", pages.LoginBookmarkPage)
self.Get("/addBookmark/:id", pages.AddBookmarkRoute)
self.Get("/deleteBookmark/:id", pages.DeleteBookmarkRoute)
self.Get("/like/:id", pages.LikeRoute)
self.Post("/addBookmark/:id", pages.AddBookmarkRoute)
self.Post("/deleteBookmark/:id", pages.DeleteBookmarkRoute)
self.Post("/like/:id", pages.LikeRoute)
server.Get("tags/:name", pages.TagPage)
server.Post("tags",
+14
View File
@@ -54,6 +54,20 @@
<br />
</div>
<div class="illust-tags">
<!--
To know if this artwork is bookmarked:
```
{{ if Illust.Bookmarked }}
<button>Unbookmark</button>
//...
{{ else }}
<button>Bookmarked</button>
//...
{{ end }}
```
Same with Illust.Liked
-->
<span class="illust-tag-attr">
<img src="/assets/eye.png" alt="Views" />
{{ Illust.Views }}