mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-06-27 15:38:23 +00:00
cleaner tag parameters
This commit is contained in:
parent
5c3289d5db
commit
33f306472f
@ -69,10 +69,7 @@ func (client *Client) FetchTag(tag string, sort string, page string) (Tag, error
|
||||
func(key, value gjson.Result) bool {
|
||||
url, _ := url.Parse(strings.ReplaceAll(value.Get("url").String(), "https://imgur.com", ""))
|
||||
q := url.Query()
|
||||
q.Add("tag", tag)
|
||||
q.Add("sort", sort)
|
||||
q.Add("page", page)
|
||||
q.Add("i", key.String())
|
||||
q.Add("tag", tag+"."+sort+"."+page+"."+key.String())
|
||||
url.RawQuery = q.Encode()
|
||||
|
||||
posts = append(posts, Submission{
|
||||
|
@ -80,8 +80,12 @@ func HandlePost(c *fiber.Ctx) error {
|
||||
}
|
||||
c.Set("Content-Security-Policy", csp)
|
||||
|
||||
tag, sort, page, index := c.Query("tag"), c.Query("sort"), c.Query("page"), c.Query("i")
|
||||
next := nextInTag(ApiClient, tag, sort, page, index)
|
||||
var next string
|
||||
tagParam := strings.Split(c.Query("tag"), ".")
|
||||
if len(tagParam) == 4 {
|
||||
tag, sort, page, index := tagParam[0], tagParam[1], tagParam[2], tagParam[3]
|
||||
next = nextInTag(ApiClient, tag, sort, page, index)
|
||||
}
|
||||
|
||||
return c.Render("post", fiber.Map{
|
||||
"post": post,
|
||||
|
Loading…
Reference in New Issue
Block a user