| 477 | } |
| 478 | |
| 479 | void EnsureMetadataTask::modrinthCallback(ModPlatform::IndexedPack& pack, ModPlatform::IndexedVersion& ver, Mod* mod) |
| 480 | { |
| 481 | // Prevent file name mismatch |
| 482 | ver.fileName = mod->fileinfo().fileName(); |
| 483 | if (ver.fileName.endsWith(".disabled")) |
| 484 | ver.fileName.chop(9); |
| 485 | |
| 486 | QDir tmp_index_dir(m_index_dir); |
| 487 | |
| 488 | { |
| 489 | LocalModUpdateTask update_metadata(m_index_dir, pack, ver); |
| 490 | QEventLoop loop; |
| 491 | |
| 492 | QObject::connect(&update_metadata, &Task::finished, &loop, &QEventLoop::quit); |
| 493 | |
| 494 | update_metadata.start(); |
| 495 | |
| 496 | if (!update_metadata.isFinished()) |
| 497 | loop.exec(); |
| 498 | } |
| 499 | |
| 500 | auto metadata = Metadata::get(tmp_index_dir, pack.slug); |
| 501 | if (!metadata.isValid()) { |
| 502 | qCritical() << "Failed to generate metadata at last step!"; |
| 503 | emitFail(mod); |
| 504 | return; |
| 505 | } |
| 506 | |
| 507 | mod->setMetadata(metadata); |
| 508 | |
| 509 | emitReady(mod); |
| 510 | } |
| 511 | |
| 512 | void EnsureMetadataTask::flameCallback(ModPlatform::IndexedPack& pack, ModPlatform::IndexedVersion& ver, Mod* mod) |
| 513 | { |
nothing calls this directly
no test coverage detected