From 1ebbb81b0722911cd971881a74c03fd5f87c10e9 Mon Sep 17 00:00:00 2001 From: Sude Date: Mon, 26 Aug 2024 21:16:16 +0300 Subject: [PATCH] Fix item url in wishlist --- src/website.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/website.cpp b/src/website.cpp index a414e83..5aa42cd 100644 --- a/src/website.cpp +++ b/src/website.cpp @@ -702,10 +702,13 @@ std::vector Website::getWishlistItems() item.store_credit = product["price"]["bonusStoreCreditAmount"].isDouble() ? std::to_string(product["price"]["bonusStoreCreditAmount"].asDouble()) + item.currency : product["price"]["bonusStoreCreditAmount"].asString() + item.currency; item.url = product["url"].asString(); - if (item.url.find("/game/") == 0) - item.url = "https://www.gog.com" + item.url; - else if (item.url.find("/movie/") == 0) - item.url = "https://www.gog.com" + item.url; + if (!(item.url.find("http") == 0)) + { + if (item.url.front() == '/') + item.url = "https://www.gog.com" + item.url; + else + item.url = "https://www.gog.com/" + item.url; + } item.title = product["title"].asString(); item.bIsBonusStoreCreditIncluded = product["price"]["isBonusStoreCreditIncluded"].asBool();