Fix item url in wishlist

This commit is contained in:
Sude 2024-08-26 21:16:16 +03:00
parent 5cdee34b99
commit 1ebbb81b07

View File

@ -702,10 +702,13 @@ std::vector<wishlistItem> 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.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(); item.url = product["url"].asString();
if (item.url.find("/game/") == 0) if (!(item.url.find("http") == 0))
item.url = "https://www.gog.com" + item.url; {
else if (item.url.find("/movie/") == 0) if (item.url.front() == '/')
item.url = "https://www.gog.com" + item.url; item.url = "https://www.gog.com" + item.url;
else
item.url = "https://www.gog.com/" + item.url;
}
item.title = product["title"].asString(); item.title = product["title"].asString();
item.bIsBonusStoreCreditIncluded = product["price"]["isBonusStoreCreditIncluded"].asBool(); item.bIsBonusStoreCreditIncluded = product["price"]["isBonusStoreCreditIncluded"].asBool();