add archived project warning
Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
This commit is contained in:
parent
e39a03421a
commit
358cf5b348
@ -122,6 +122,8 @@ struct ExtraPackData {
|
||||
QString wikiUrl;
|
||||
QString discordUrl;
|
||||
|
||||
QString status;
|
||||
|
||||
QString body;
|
||||
};
|
||||
|
||||
|
@ -104,6 +104,8 @@ void Modrinth::loadExtraPackData(ModPlatform::IndexedPack& pack, QJsonObject& ob
|
||||
pack.extraData.donate.append(donate);
|
||||
}
|
||||
|
||||
pack.extraData.status = Json::ensureString(obj, "status");
|
||||
|
||||
pack.extraData.body = Json::ensureString(obj, "body").remove("<br>");
|
||||
|
||||
pack.extraDataLoaded = true;
|
||||
|
@ -95,6 +95,8 @@ void loadIndexedInfo(Modpack& pack, QJsonObject& obj)
|
||||
pack.extra.donate.append(donate);
|
||||
}
|
||||
|
||||
pack.extra.status = Json::ensureString(obj, "status");
|
||||
|
||||
pack.extraInfoLoaded = true;
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,8 @@ struct ModpackExtra {
|
||||
QString discordUrl;
|
||||
|
||||
QList<DonationData> donate;
|
||||
|
||||
QString status;
|
||||
};
|
||||
|
||||
struct ModpackVersion {
|
||||
|
@ -200,6 +200,10 @@ void ResourcePage::updateUi()
|
||||
}
|
||||
|
||||
if (current_pack->extraDataLoaded) {
|
||||
if (current_pack->extraData.status == "archived") {
|
||||
text += "<br><br>" + tr("<b>This project has been archived. It will not receive any further updates unless the author decides to unarchive the project.</b>");
|
||||
}
|
||||
|
||||
if (!current_pack->extraData.donate.isEmpty()) {
|
||||
text += "<br><br>" + tr("Donate information: ");
|
||||
auto donateToStr = [](ModPlatform::DonationData& donate) -> QString {
|
||||
|
@ -142,7 +142,7 @@ void ModpackListModel::performPaginatedSearch()
|
||||
callbacks.on_succeed = [this](auto& doc, auto& pack) { searchRequestForOneSucceeded(doc); };
|
||||
callbacks.on_abort = [this] {
|
||||
qCritical() << "Search task aborted by an unknown reason!";
|
||||
searchRequestFailed("Abborted");
|
||||
searchRequestFailed("Aborted");
|
||||
};
|
||||
static const ModrinthAPI api;
|
||||
if (auto job = api.getProjectInfo({ projectId }, std::move(callbacks)); job) {
|
||||
|
@ -267,6 +267,10 @@ void ModrinthPage::updateUI()
|
||||
text += "<br>" + tr(" by ") + QString("<a href=%1>%2</a>").arg(std::get<1>(current.author).toString(), std::get<0>(current.author));
|
||||
|
||||
if (current.extraInfoLoaded) {
|
||||
if (current.extra.status == "archived") {
|
||||
text += "<br><br>" + tr("<b>This project has been archived. It will not receive any further updates unless the author decides to unarchive the project.</b>");
|
||||
}
|
||||
|
||||
if (!current.extra.donate.isEmpty()) {
|
||||
text += "<br><br>" + tr("Donate information: ");
|
||||
auto donateToStr = [](Modrinth::DonationData& donate) -> QString {
|
||||
|
Loading…
Reference in New Issue
Block a user