mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Add fallback urls for cards without a muId set
We only have a good HQ source for them; any idea on a low-quality source?
This commit is contained in:
parent
6b1df247d1
commit
fc1d06e13b
3 changed files with 30 additions and 6 deletions
|
|
@ -224,16 +224,18 @@ QString PictureLoader::getPicUrl()
|
|||
return picUrl;
|
||||
}
|
||||
|
||||
// otherwise, fallback to the default url
|
||||
picUrl = picDownloadHq ? settingsCache->getPicUrlHq() : settingsCache->getPicUrl();
|
||||
picUrl.replace("!name!", QUrl::toPercentEncoding(card->getCorrectedName()));
|
||||
// if a card has a muid, use the default url; if not, use the fallback
|
||||
int muid = set ? muid = card->getMuId(set->getShortName()) : 0;
|
||||
if(muid)
|
||||
picUrl = picDownloadHq ? settingsCache->getPicUrlHq() : settingsCache->getPicUrl();
|
||||
else
|
||||
picUrl = picDownloadHq ? settingsCache->getPicUrlHqFallback() : settingsCache->getPicUrlFallback();
|
||||
|
||||
picUrl.replace("!name!", QUrl::toPercentEncoding(card->getCorrectedName()));
|
||||
picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid)));
|
||||
if (set) {
|
||||
picUrl.replace("!setcode!", QUrl::toPercentEncoding(set->getShortName()));
|
||||
picUrl.replace("!setname!", QUrl::toPercentEncoding(set->getLongName()));
|
||||
int muid = card->getMuId(set->getShortName());
|
||||
if (muid)
|
||||
picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid)));
|
||||
}
|
||||
|
||||
if (picUrl.contains("!name!") ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue