refactor: 移除遥测并修复启动器流程

This commit is contained in:
Disy committed 2026-09-13 20:32:57 +08:00
1 parent 1fa56add19
commit 1593ac7a7c
175 files changed
+547 -12210

No files matched your search

@@ -117,7 +117,6 @@ pub async fn import_curseforge(
&thumbnail_url,
None,
None,
None,
&state.fetch_semaphore,
&state.pool,
)
+2 -22
View File
@@ -12,9 +12,8 @@ use crate::state::{
ModrinthVersionId, SideType,
};
use crate::util::fetch::{
ContentValidation, DownloadMeta, DownloadReason, DownloadRequest,
FetchProgressFn, Integrity, ResourceClass, download_to_path, fetch,
sha1_file_async, write_cached_icon,
ContentValidation, DownloadRequest, FetchProgressFn, Integrity,
ResourceClass, download_to_path, fetch, sha1_file_async, write_cached_icon,
};
use path_util::SafeRelativeUtf8UnixPathBuf;
use serde::{Deserialize, Serialize};
@@ -267,7 +266,6 @@ pub(crate) async fn generate_pack_from_version_id_with_reporter(
title: String,
icon_url: Option<String>,
instance_id: String,
reason: DownloadReason,
reporter: InstallProgressReporter,
) -> crate::Result<CreatePack> {
let state = State::get().await?;
@@ -340,22 +338,6 @@ pub(crate) async fn generate_pack_from_version_id_with_reporter(
.join(&version_id)
.join(file_name);
let metadata =
crate::api::instance::get(&instance_id)
.await?
.ok_or_else(|| {
crate::ErrorKind::InputError(format!(
"Unknown instance {instance_id}"
))
})?;
let download_meta = DownloadMeta {
reason,
game_version: metadata.applied_content_set.game_version.clone(),
loader: metadata.applied_content_set.loader.as_str().to_string(),
dependent_on: Some(version_id.clone()),
};
let details = InstallPhaseDetails::Modpack {
project_id: Some(project_id.clone()),
version_id: Some(version_id.clone()),
@@ -430,7 +412,6 @@ pub(crate) async fn generate_pack_from_version_id_with_reporter(
..Integrity::default()
})
.with_h2_range_concurrency(16)
.with_download_meta(download_meta)
.with_install_tracking(
reporter.clone(),
pack_path.display().to_string(),
@@ -487,7 +468,6 @@ pub(crate) async fn generate_pack_from_version_id_with_reporter(
&icon_url,
None,
None,
None,
&state.fetch_semaphore,
&state.pool,
)
@@ -23,8 +23,8 @@ use crate::state::{
Settings, SideType,
};
use crate::util::fetch::{
ContentValidation, DownloadMeta, DownloadReason, DownloadRequest,
Integrity, ResourceClass, download_to_path, sha1_file_async,
ContentValidation, DownloadRequest, Integrity, ResourceClass,
download_to_path, sha1_file_async,
};
use crate::util::io;
use async_zip::base::read::seek::ZipFileReader as SeekZipFileReader;
@@ -219,7 +219,6 @@ fn missing_required_content_pause(
struct ModpackContentInstallContext {
instance_id: String,
instance_full_path: PathBuf,
download_meta: DownloadMeta,
pack_version_id: Option<String>,
pack_project_id: Option<String>,
reporter: InstallProgressReporter,
@@ -689,7 +688,6 @@ where
pub(crate) async fn install_zipped_mrpack_files_with_reporter(
create_pack: CreatePack,
ignore_lock: bool,
reason: DownloadReason,
reporter: InstallProgressReporter,
) -> crate::Result<MrpackInstallOutcome> {
let state = &State::get().await?;
@@ -806,21 +804,6 @@ pub(crate) async fn install_zipped_mrpack_files_with_reporter(
)
.await?;
let metadata =
crate::api::instance::get(&instance_id)
.await?
.ok_or_else(|| {
crate::ErrorKind::InputError(format!(
"Unknown instance {instance_id}"
))
})?;
let download_meta = DownloadMeta {
reason,
game_version: metadata.applied_content_set.game_version.clone(),
loader: metadata.applied_content_set.loader.as_str().to_string(),
dependent_on: version_id.clone(),
};
let num_files = pack.files.len();
let content_total_bytes = pack
.files
@@ -892,7 +875,6 @@ pub(crate) async fn install_zipped_mrpack_files_with_reporter(
let content_context = ModpackContentInstallContext {
instance_id: instance_id.clone(),
instance_full_path: instance_full_path.clone(),
download_meta,
pack_version_id: version_id.clone(),
pack_project_id: project_id.clone(),
reporter: reporter.clone(),
@@ -1191,9 +1173,6 @@ pub(crate) async fn install_zipped_mrpack_files_with_reporter(
project.downloads.iter().skip(1).cloned(),
)
.with_integrity(integrity)
.with_download_meta(
content_context.download_meta.clone(),
)
.with_segmented_download(true)
.with_http1_segmented_download(false)
.with_install_tracking(