Skip to content

Commit

Permalink
Only create empty meta file if Nexus error code is 404
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanFeenstra committed Dec 14, 2024
1 parent a32cb77 commit a44c0f8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/downloadmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,6 @@ void DownloadManager::queryInfo(int index)
QString ignore;
NexusInterface::interpretNexusFileName(fileName, ignore, info->m_FileInfo->modID,
info->m_AskIfNotFound);
if (!info->m_AskIfNotFound && (info->m_FileInfo->modID < 0) ||
info->m_FileInfo->gameName.isEmpty()) {
// prevent re-querying (only possible with Nexus)
info->m_FileInfo->repository = "";
setState(info, STATE_READY);
return;
}

if (info->m_FileInfo->modID < 0) {
bool ok = false;
int modId = QInputDialog::getInt(nullptr, tr("Please enter the Nexus mod ID"),
Expand All @@ -1106,6 +1098,12 @@ void DownloadManager::queryInfo(int index)
}

if (info->m_FileInfo->gameName.isEmpty()) {
if (!info->m_AskIfNotFound) {
// in case the info couldn't be retrieved from Nexus due to connection issues,
// don't create a meta file so you can query again after the issues are resolved.
return;
}

SelectionDialog selection(
tr("Please select the source game code for %1").arg(getFileName(index)));

Expand Down Expand Up @@ -2172,6 +2170,11 @@ void DownloadManager::nxmRequestFailed(QString gameName, int modID, int fileID,
info->m_GamesToQuery.pop_front();
setState(info, STATE_FETCHINGMODINFO_MD5);
return;
} else if (errorCode == 404 && !info->m_AskIfNotFound) {
// prevent re-querying (only possible with repository = "Nexus")
info->m_FileInfo->repository = "";
setState(info, STATE_READY);
return;
} else {
info->m_State = STATE_READY;
queryInfo(index);
Expand Down

0 comments on commit a44c0f8

Please sign in to comment.