Update connected library install reason
All checks were successful
Codex Template Compliance / template-compliance (push) Successful in 8s
Build / build-windows (push) Successful in 32m47s

This commit is contained in:
MrSphay
2026-05-16 14:13:14 +02:00
parent bff85c27b7
commit 20ff3453bc

View File

@@ -2,6 +2,7 @@ use crate::pack::install_from::{CreatePack, CreatePackDescription};
use crate::pack::install_mrpack::install_zipped_mrpack_files;
use crate::profile;
use crate::state::ModLoader;
use crate::util::fetch::DownloadReason;
use crate::{ErrorKind, State};
use chrono::{TimeZone, Utc};
use serde::{Deserialize, Serialize};
@@ -259,6 +260,11 @@ pub async fn install(id: String) -> crate::Result<ConnectedPack> {
let state = State::get().await?;
let pack = get_by_id(&state.pool, &id).await?;
let bytes = fetch_mrpack(&pack.mrpack_url, &pack.sha512).await?;
let download_reason = if pack.profile_path.is_some() {
DownloadReason::Update
} else {
DownloadReason::Modpack
};
let profile_path = if let Some(profile_path) = &pack.profile_path {
profile_path.clone()
@@ -287,7 +293,7 @@ pub async fn install(id: String) -> crate::Result<ConnectedPack> {
},
};
install_zipped_mrpack_files(create_pack, true).await?;
install_zipped_mrpack_files(create_pack, true, download_reason).await?;
sqlx::query(
"