mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Merge pull request #1141 from ZeldaZach/hq_options2
Allow Custom Download URL
This commit is contained in:
commit
8cf0c3beed
4 changed files with 42 additions and 10 deletions
|
|
@ -337,16 +337,26 @@ QString PictureLoader::getPicUrl()
|
|||
picUrl = picDownloadHq ? settingsCache->getPicUrlHqFallback() : settingsCache->getPicUrlFallback();
|
||||
|
||||
picUrl.replace("!name!", QUrl::toPercentEncoding(card->getCorrectedName()));
|
||||
picUrl.replace("!name_lower!", QUrl::toPercentEncoding(card->getCorrectedName().toLower()));
|
||||
picUrl.replace("!cardid!", QUrl::toPercentEncoding(QString::number(muid)));
|
||||
if (set) {
|
||||
if (set)
|
||||
{
|
||||
picUrl.replace("!setcode!", QUrl::toPercentEncoding(set->getShortName()));
|
||||
picUrl.replace("!setcode_lower!", QUrl::toPercentEncoding(set->getShortName().toLower()));
|
||||
picUrl.replace("!setname!", QUrl::toPercentEncoding(set->getLongName()));
|
||||
picUrl.replace("!setname_lower!", QUrl::toPercentEncoding(set->getLongName().toLower()));
|
||||
}
|
||||
|
||||
if (picUrl.contains("!name!") ||
|
||||
picUrl.contains("!setcode!") ||
|
||||
picUrl.contains("!setname!") ||
|
||||
picUrl.contains("!cardid!")) {
|
||||
if (
|
||||
picUrl.contains("!name!") ||
|
||||
picUrl.contains("!name_lower!") ||
|
||||
picUrl.contains("!setcode!") ||
|
||||
picUrl.contains("!setcode_lower!") ||
|
||||
picUrl.contains("!setname!") ||
|
||||
picUrl.contains("!setname_lower!") ||
|
||||
picUrl.contains("!cardid!")
|
||||
)
|
||||
{
|
||||
qDebug() << "Insufficient card data to download" << card->getName() << "Url:" << picUrl;
|
||||
return QString("");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue