GH-4699 Clean some things up

Add a menu to select between MMC/Modrinth format packs instead of the custom dialog
Treat 404s on requests to the Modrinth API as success, as the API returns a 404 if a hash was not found, and we don't want to retry the download in this case
Improve logging
This commit is contained in:
arthomnix
2023-02-05 10:13:13 +00:00
parent 16cf56b7a4
commit 74addfb78b
8 changed files with 46 additions and 182 deletions

View File

@@ -122,6 +122,13 @@ void Download::downloadError(QNetworkReply::NetworkError error)
qCritical() << "Aborted " << m_url.toString();
m_status = Job_Aborted;
}
else if(error == QNetworkReply::ContentNotFoundError && (m_options & Option::AllowNotFound))
{
// The Modrinth API returns a 404 when a hash was not found when performing reverse hash lookup, we don't want to treat this as a failure
qDebug() << "Received 404 from " << m_url.toString() << ", continuing...";
m_status = Job_Finished;
return;
}
else
{
if(m_options & Option::AcceptLocalFiles)

View File

@@ -32,7 +32,8 @@ public: /* types */
enum class Option
{
NoOptions = 0,
AcceptLocalFiles = 1
AcceptLocalFiles = 1,
AllowNotFound =2
};
Q_DECLARE_FLAGS(Options, Option)