diff --git a/example_config.json b/example_config.json index 467298d..78855cf 100644 --- a/example_config.json +++ b/example_config.json @@ -8,7 +8,7 @@ "connection": { "type": "ip", "address": "127.0.0.1", - "port": 6389, + "port": 6379, "unix": "/path/to/redis.sock" }, "username": null, diff --git a/routes/artworks.cpp b/routes/artworks.cpp index 4fff9af..f6d1559 100644 --- a/routes/artworks.cpp +++ b/routes/artworks.cpp @@ -80,13 +80,13 @@ static inline Element generate_images(const httplib::Request& req, const Config& const Images& images = illust.images[i]; const Image& thumbnail = images.thumbnail_or_original(); const Image& original = images.original_or_thumbnail(); + std::string id = std::to_string(i + 1); if (show_pages) { - std::string id = std::to_string(i + 1); - div.nodes.push_back(Element("a", {{"class", "landmark"}, {"id", id}, {"href", "#"s + id}}, {id, "/", std::to_string(illust.images.size())})); + div.nodes.push_back(Element("a", {{"class", "landmark"}, {"href", "#"s + id}}, {id, "/", std::to_string(illust.images.size())})); } - Element img("img", {{"loading", "lazy"}, {"src", proxy_image_url(req, config, thumbnail.url)}}, {}); + Element img("img", {{"loading", "lazy"}, {"id", std::move(id)}, {"src", proxy_image_url(req, config, thumbnail.url)}}, {}); if (thumbnail.size) { img.attributes.push_back({"width", std::to_string(thumbnail.size->first)}); img.attributes.push_back({"height", std::to_string(thumbnail.size->second)});