Show correct art on middle mouse popup (#5385)

This commit is contained in:
Zach H 2024-12-29 18:24:32 -05:00 committed by GitHub
parent dec001114a
commit dad1aea128
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 33 additions and 24 deletions

View file

@ -501,13 +501,14 @@ CardInfoPtr CardDatabase::getCardBySimpleName(const QString &cardName) const
return getCardFromMap(simpleNameCards, CardInfo::simplifyName(cardName));
}
CardInfoPtr CardDatabase::guessCard(const QString &cardName) const
CardInfoPtr CardDatabase::guessCard(const QString &cardName, const QString &providerId) const
{
CardInfoPtr temp = getCard(cardName);
CardInfoPtr temp = providerId.isEmpty() ? getCard(cardName) : getCardByNameAndProviderId(cardName, providerId);
if (temp == nullptr) { // get card by simple name instead
temp = getCardBySimpleName(cardName);
if (temp == nullptr) { // still could not find the card, so simplify the cardName too
QString simpleCardName = CardInfo::simplifyName(cardName);
const auto &simpleCardName = CardInfo::simplifyName(cardName);
temp = getCardBySimpleName(simpleCardName);
}
}