refactor: Use a single indexed pack for mods

Since there's little difference between them, let's remove duplication
and merge them.
This commit is contained in:
flow
2022-03-02 18:35:59 -03:00
parent ca211558b5
commit 881b2f2b38
13 changed files with 137 additions and 166 deletions

View File

@ -77,7 +77,7 @@ void FlameModPage::onSelectionChanged(QModelIndex first, QModelIndex second) {
return;
}
current = listModel->data(first, Qt::UserRole).value<FlameMod::IndexedPack>();
current = listModel->data(first, Qt::UserRole).value<ModPlatform::IndexedPack>();
QString text = "";
QString name = current.name;
@ -86,7 +86,7 @@ void FlameModPage::onSelectionChanged(QModelIndex first, QModelIndex second) {
else
text = "<a href=\"" + current.websiteUrl + "\">" + name + "</a>";
if (!current.authors.empty()) {
auto authorToStr = [](FlameMod::ModpackAuthor &author) {
auto authorToStr = [](ModPlatform::ModpackAuthor &author) {
if (author.url.isEmpty()) {
return author.name;
}
@ -112,7 +112,7 @@ void FlameModPage::onSelectionChanged(QModelIndex first, QModelIndex second) {
new NetJob(QString("Flame::ModVersions(%1)").arg(current.name),
APPLICATION->network());
auto response = new QByteArray();
int addonId = current.addonId;
int addonId = current.addonId.toInt();
netJob->addNetAction(Net::Download::makeByteArray(
QString("https://addons-ecs.forgesvc.net/api/v2/addon/%1/files")
.arg(addonId),