@@ -444,20 +444,38 @@ void DownloadManager::queryDownloadListInfo()
444
444
{
445
445
TimeThis tt (" DownloadManager::queryDownloadListInfos()" );
446
446
447
- startDisableDirWatcher ();
448
-
449
447
log::info (" Retrieving infos from every download (if possible)..." );
450
448
449
+ int incompleteInfos = 0 ;
450
+
451
451
// Just go through all active downloads to query infos
452
452
for (size_t i = 0 ; i < m_ActiveDownloads.size (); i++) {
453
453
if (isInfoIncomplete (i)) {
454
- queryInfoMd5 (i) ;
454
+ incompleteInfos++ ;
455
455
}
456
456
}
457
457
458
- log::info (" Files infos have been retrived successfully!" );
458
+ // Warn the user if the number of incomplete infos is over 5
459
+ if (incompleteInfos > 5 ) {
460
+ QString message = tr (" There %1 incomplete download meta files.\n\n "
461
+ " Do you want to fetch metadata for all incomplete downloads?\n "
462
+ " API uses will be consumed, and Mod Organizer may stutter." );
463
+ message = message.arg (incompleteInfos);
464
+ if (QMessageBox::question (m_ParentWidget, tr (" Incomplete Download Infos" ), message,
465
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
466
+ // Fetch metadata for incomplete download infos
467
+ startDisableDirWatcher ();
468
+ for (size_t i = 0 ; i < m_ActiveDownloads.size (); i++) {
469
+ if (isInfoIncomplete (i)) {
470
+ queryInfoMd5 (i);
471
+ }
472
+ }
473
+ endDisableDirWatcher ();
474
+ }
475
+ return ;
476
+ }
459
477
460
- endDisableDirWatcher ( );
478
+ log::info ( " Files infos have been retrieved successfully! " );
461
479
}
462
480
463
481
bool DownloadManager::addDownload (const QStringList& URLs, QString gameName, int modID,
0 commit comments