Merge branch 'main' into fetch/download-signed-compliance-form

This commit is contained in:
François-X. T
2025-10-04 22:14:15 +02:00
19 changed files with 1395 additions and 1020 deletions
-10
View File
@@ -279,16 +279,6 @@ async function setupApp() {
const settings = await getSettings()
settings.pending_update_toast_for_version = null
await setSettings(settings)
const version = await getVersion()
if (pending_update_toast_for_version === version) {
addNotification({
type: 'success',
title: formatMessage(messages.updateInstalledToastTitle, { version }),
text: formatMessage(messages.updateInstalledToastText),
clickAction: () => openUrl('https://modrinth.com/news/changelog?filter=app'),
})
}
}
if (osType === 'windows') {
+1
View File
@@ -11,6 +11,7 @@ tauri-build = { workspace = true, features = ["codegen"] }
[dependencies]
theseus = { workspace = true, features = ["tauri"] }
path-util.workspace = true
serde_json.workspace = true
serde = { workspace = true, features = ["derive"] }
+2 -1
View File
@@ -1,5 +1,6 @@
use crate::api::Result;
use dashmap::DashMap;
use path_util::SafeRelativeUtf8UnixPathBuf;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::path::{Path, PathBuf};
@@ -239,7 +240,7 @@ pub async fn profile_export_mrpack(
#[tauri::command]
pub async fn profile_get_pack_export_candidates(
profile_path: &str,
) -> Result<Vec<String>> {
) -> Result<Vec<SafeRelativeUtf8UnixPathBuf>> {
let candidates = profile::get_pack_export_candidates(profile_path).await?;
Ok(candidates)
}
+1
View File
@@ -133,6 +133,7 @@ rusty-money.workspace = true
json-patch.workspace = true
ariadne.workspace = true
path-util.workspace = true
clap = { workspace = true, features = ["derive"] }
+2 -1
View File
@@ -1,6 +1,7 @@
use crate::{
models::v2::projects::LegacySideType, util::env::parse_strings_from_var,
};
use path_util::SafeRelativeUtf8UnixPathBuf;
use serde::{Deserialize, Serialize};
use validator::Validate;
@@ -23,7 +24,7 @@ pub struct PackFormat {
#[derive(Serialize, Deserialize, Validate, Eq, PartialEq, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct PackFile {
pub path: String,
pub path: SafeRelativeUtf8UnixPathBuf,
pub hashes: std::collections::HashMap<PackFileHash, String>,
pub env: Option<std::collections::HashMap<EnvType, LegacySideType>>, // TODO: Should this use LegacySideType? Will probably require a overhaul of mrpack format to change this
#[validate(custom(function = "validate_download_url"))]
+1 -1
View File
@@ -304,7 +304,7 @@ impl AutomatedModerationQueue {
let hash = x.hashes.get(&PackFileHash::Sha1);
if let Some(hash) = hash {
let path = x.path.clone();
let path = x.path.to_string();
Some((hash.clone(), Some(x), path, None))
} else {
None
+2 -3
View File
@@ -23,8 +23,7 @@ use ariadne::ids::base62_impl::{parse_base62, to_base62};
use chrono::{Duration, Utc};
use rust_decimal::Decimal;
use rust_decimal::prelude::ToPrimitive;
use serde::Serialize;
use serde_with::serde_derive::Deserialize;
use serde::{Deserialize, Serialize};
use sqlx::{PgPool, Postgres, Transaction};
use std::collections::HashMap;
use std::str::FromStr;
@@ -290,7 +289,7 @@ pub async fn refund_charge(
currency_code: charge.currency_code.clone(),
accounting_time: Utc::now(),
accounting_time_zone: anrok::AccountingTimeZone::Utc,
line_items: vec![anrok::LineItem::new_including_tax_amount(tax_id, refund_amount)],
line_items: vec![anrok::LineItem::new_including_tax_amount(tax_id, -refund_amount)],
}
}
).await;
-19
View File
@@ -4,7 +4,6 @@ use crate::validate::{
SupportedGameVersions, ValidationError, ValidationResult,
};
use std::io::{Cursor, Read};
use std::path::Component;
use validator::Validate;
use zip::ZipArchive;
@@ -72,24 +71,6 @@ impl super::Validator for ModpackValidator {
"All pack files must provide a SHA512 hash!".into(),
));
}
let path = std::path::Path::new(&file.path)
.components()
.next()
.ok_or_else(|| {
ValidationError::InvalidInput(
"Invalid pack file path!".into(),
)
})?;
match path {
Component::CurDir | Component::Normal(_) => {}
_ => {
return Err(ValidationError::InvalidInput(
"Invalid pack file path!".into(),
));
}
};
}
Ok(ValidationResult::PassWithPackDataAndFiles {