Skip to content

Commit

Permalink
Fix item url in wishlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Sude- committed Aug 26, 2024
1 parent 5cdee34 commit 1ebbb81
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/website.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.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();
Expand Down

0 comments on commit 1ebbb81

Please sign in to comment.