Skip to content

Commit a44c0f8

Browse files
Only create empty meta file if Nexus error code is 404
1 parent a32cb77 commit a44c0f8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/downloadmanager.cpp

+11-8
Original file line numberDiff line numberDiff line change
@@ -1084,14 +1084,6 @@ void DownloadManager::queryInfo(int index)
10841084
QString ignore;
10851085
NexusInterface::interpretNexusFileName(fileName, ignore, info->m_FileInfo->modID,
10861086
info->m_AskIfNotFound);
1087-
if (!info->m_AskIfNotFound && (info->m_FileInfo->modID < 0) ||
1088-
info->m_FileInfo->gameName.isEmpty()) {
1089-
// prevent re-querying (only possible with Nexus)
1090-
info->m_FileInfo->repository = "";
1091-
setState(info, STATE_READY);
1092-
return;
1093-
}
1094-
10951087
if (info->m_FileInfo->modID < 0) {
10961088
bool ok = false;
10971089
int modId = QInputDialog::getInt(nullptr, tr("Please enter the Nexus mod ID"),
@@ -1106,6 +1098,12 @@ void DownloadManager::queryInfo(int index)
11061098
}
11071099

11081100
if (info->m_FileInfo->gameName.isEmpty()) {
1101+
if (!info->m_AskIfNotFound) {
1102+
// in case the info couldn't be retrieved from Nexus due to connection issues,
1103+
// don't create a meta file so you can query again after the issues are resolved.
1104+
return;
1105+
}
1106+
11091107
SelectionDialog selection(
11101108
tr("Please select the source game code for %1").arg(getFileName(index)));
11111109

@@ -2172,6 +2170,11 @@ void DownloadManager::nxmRequestFailed(QString gameName, int modID, int fileID,
21722170
info->m_GamesToQuery.pop_front();
21732171
setState(info, STATE_FETCHINGMODINFO_MD5);
21742172
return;
2173+
} else if (errorCode == 404 && !info->m_AskIfNotFound) {
2174+
// prevent re-querying (only possible with repository = "Nexus")
2175+
info->m_FileInfo->repository = "";
2176+
setState(info, STATE_READY);
2177+
return;
21752178
} else {
21762179
info->m_State = STATE_READY;
21772180
queryInfo(index);

0 commit comments

Comments
 (0)