diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 25ca7369b..b10f9b7f5 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -416,6 +417,24 @@ int main(int argc, char *argv[]) CardDatabaseManager::setCardDatabasePathProvider(&SettingsCache::instance()); CardDatabaseManager::setCardSetPriorityController(&SettingsCache::instance().cardDatabase()); + // Existing early fork profiles may still contain the upstream Scryfall / + // Gatherer defaults saved by older builds. Migrate only known MTG provider + // URLs, leaving user-authored Continuum Universes endpoints untouched. + auto &downloadSettings = SettingsCache::instance().downloads(); + const QStringList savedImageUrls = downloadSettings.getAllURLs(); + QStringList compatibleImageUrls; + for (const QString &url : savedImageUrls) { + if (!url.contains(QStringLiteral("scryfall.com"), Qt::CaseInsensitive) && + !url.contains(QStringLiteral("scryfall.io"), Qt::CaseInsensitive) && + !url.contains(QStringLiteral("gatherer.wizards.com"), Qt::CaseInsensitive)) { + compatibleImageUrls.append(url); + } + } + if (compatibleImageUrls != savedImageUrls) { + downloadSettings.setDownloadUrls(compatibleImageUrls); + qCInfo(MainLog) << "Removed inherited MTG image sources from Continuumatrice profile."; + } + qCInfo(MainLog) << "Starting main program"; // Front-load the card database before constructing the main window. The