- re-export 可见性:synced_options_path 改从 files 导入;SyncedOptionJoinResolution 改从 pending 导入 - bind 移动语义:18 处 .bind(x) 改为 .bind(&x)(metadata.instance.id / option_id / custom_id 等) - storage.rs:SqliteRow 字段访问改为 row.get() - modpack.rs:去掉 Axolotl 独有的 DownloadMeta/DownloadReason,改用本地 5 参数 fetch - state/mod.rs:补齐第 2 处 State 初始化的新增字段
This commit is contained in:
1 parent
fae16a0184
commit
b7c16594ce
10 files changed
+42
-40
No files matched your search
@@ -2,10 +2,9 @@ use super::COMMAND_HISTORY_FILE;
|
||||
use super::files::{
|
||||
CheckpointStatus, begin_checkpoint, checkpoint, ensure_link,
|
||||
finish_checkpoint, instance_game_dir, sha1_bytes, sha1_file,
|
||||
synced_options_path,
|
||||
};
|
||||
use super::orchestration::{
|
||||
create_synced_directories, option_effective, synced_options_path,
|
||||
};
|
||||
use super::orchestration::{create_synced_directories, option_effective};
|
||||
use crate::State;
|
||||
use crate::state::{InstanceMetadata, SyncedOption};
|
||||
use crate::util::io;
|
||||
|
||||
@@ -134,7 +134,7 @@ pub(in crate::api::instance) async fn detach_instance(
|
||||
"DELETE FROM instance_sync_checkpoints
|
||||
WHERE instance_id = ? AND feature = ?",
|
||||
)
|
||||
.bind(metadata.instance.id)
|
||||
.bind(&metadata.instance.id)
|
||||
.bind(feature)
|
||||
.execute(&state.pool)
|
||||
.await?;
|
||||
@@ -150,7 +150,7 @@ pub(in crate::api::instance) async fn prepare_instance_update_with_state(
|
||||
sqlx::query(
|
||||
"DELETE FROM instance_game_option_update_state WHERE instance_id = ?",
|
||||
)
|
||||
.bind(metadata.instance.id)
|
||||
.bind(&metadata.instance.id)
|
||||
.execute(&state.pool)
|
||||
.await?;
|
||||
if sync_is_active_for_instance(metadata, state).await? {
|
||||
@@ -184,7 +184,7 @@ pub(in crate::api::instance) async fn prepare_instance_update_with_state(
|
||||
had_file = excluded.had_file, sha1 = excluded.sha1,
|
||||
document = excluded.document",
|
||||
)
|
||||
.bind(metadata.instance.id)
|
||||
.bind(&metadata.instance.id)
|
||||
.bind(had_file)
|
||||
.bind(sha1)
|
||||
.bind(bytes)
|
||||
|
||||
+8
-8
@@ -124,10 +124,10 @@ pub(super) async fn read_instance_changes_into_shared_settings(
|
||||
.bind(canonical_type)
|
||||
.bind(value_json)
|
||||
.bind(next_revision)
|
||||
.bind(metadata.applied_content_set.game_version)
|
||||
.bind(metadata.instance.id)
|
||||
.bind(&metadata.applied_content_set.game_version)
|
||||
.bind(&metadata.instance.id)
|
||||
.bind(now)
|
||||
.bind(option_id)
|
||||
.bind(&option_id)
|
||||
.bind(current_revision)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
@@ -209,7 +209,7 @@ pub(super) async fn discover_custom_settings(
|
||||
)
|
||||
.bind(revision)
|
||||
.bind(now)
|
||||
.bind(custom_id)
|
||||
.bind(&custom_id)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
sqlx::query(
|
||||
@@ -218,7 +218,7 @@ pub(super) async fn discover_custom_settings(
|
||||
WHERE option_id = ?",
|
||||
)
|
||||
.bind(revision)
|
||||
.bind(custom_id)
|
||||
.bind(&custom_id)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
discovered = true;
|
||||
@@ -254,7 +254,7 @@ pub(super) async fn discover_custom_settings(
|
||||
.bind(canonical_type)
|
||||
.bind(value_json)
|
||||
.bind(game_version)
|
||||
.bind(metadata.instance.id)
|
||||
.bind(&metadata.instance.id)
|
||||
.bind(now)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
@@ -320,12 +320,12 @@ pub(super) async fn discover_custom_settings(
|
||||
source_instance_id = excluded.source_instance_id,
|
||||
updated_at = excluded.updated_at",
|
||||
)
|
||||
.bind(option_id)
|
||||
.bind(&option_id)
|
||||
.bind(key)
|
||||
.bind(value_json)
|
||||
.bind(revision)
|
||||
.bind(game_version)
|
||||
.bind(metadata.instance.id)
|
||||
.bind(&metadata.instance.id)
|
||||
.bind(now)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
|
||||
@@ -436,7 +436,7 @@ pub async fn save_changes(
|
||||
source_game_version = NULL, source_instance_id = NULL,
|
||||
updated_at = excluded.updated_at",
|
||||
)
|
||||
.bind(setting.option_id)
|
||||
.bind(&setting.option_id)
|
||||
.bind(kind)
|
||||
.bind(raw_key)
|
||||
.bind(canonical_type)
|
||||
@@ -457,7 +457,7 @@ pub async fn save_changes(
|
||||
)
|
||||
.bind(revision)
|
||||
.bind(now)
|
||||
.bind(setting.option_id)
|
||||
.bind(&setting.option_id)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ pub async fn save_changes(
|
||||
enabled = excluded.enabled, source = 'user',
|
||||
revision = excluded.revision",
|
||||
)
|
||||
.bind(setting.option_id)
|
||||
.bind(&setting.option_id)
|
||||
.bind(enabled)
|
||||
.bind("user")
|
||||
.bind(revision)
|
||||
|
||||
@@ -100,7 +100,7 @@ pub(in crate::api::instance) async fn initialize_from_source_instance(
|
||||
)
|
||||
.bind(revision)
|
||||
.bind(now)
|
||||
.bind(custom_id)
|
||||
.bind(&custom_id)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
sqlx::query(
|
||||
@@ -109,7 +109,7 @@ pub(in crate::api::instance) async fn initialize_from_source_instance(
|
||||
WHERE option_id = ?",
|
||||
)
|
||||
.bind(revision)
|
||||
.bind(custom_id)
|
||||
.bind(&custom_id)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ pub(in crate::api::instance) async fn initialize_from_source_instance(
|
||||
source_instance_id = excluded.source_instance_id,
|
||||
updated_at = excluded.updated_at",
|
||||
)
|
||||
.bind(option_id)
|
||||
.bind(&option_id)
|
||||
.bind(key)
|
||||
.bind(value_json)
|
||||
.bind(option_revision)
|
||||
@@ -261,7 +261,7 @@ pub(in crate::api::instance) async fn initialize_from_source_instance(
|
||||
ON CONFLICT(option_id) DO NOTHING
|
||||
",
|
||||
)
|
||||
.bind(option_id)
|
||||
.bind(&option_id)
|
||||
.bind(option_revision)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
|
||||
@@ -3,10 +3,11 @@ use super::files::{
|
||||
CheckpointStatus, begin_checkpoint, checkpoint, ensure_link,
|
||||
finish_checkpoint, instance_game_dir, nbt_from_bytes, nbt_to_bytes,
|
||||
read_nbt_file, safe_instance_id, sha1_bytes, sha1_file,
|
||||
synced_options_path,
|
||||
};
|
||||
use super::orchestration::{
|
||||
backup_bytes, create_synced_directories, option_effective,
|
||||
seed_from_instance, synced_options_path,
|
||||
seed_from_instance,
|
||||
};
|
||||
use crate::state::{InstanceMetadata, SyncedOption};
|
||||
use crate::util::io;
|
||||
|
||||
@@ -19,8 +19,8 @@ pub(super) use self::files::{
|
||||
pub(super) use self::orchestration::instance_option_supported;
|
||||
pub use self::orchestration::{
|
||||
GlobalSyncedOptions, SyncedOptionCapability, SyncedOptionJoinAction,
|
||||
SyncedOptionJoinPreview, SyncedOptionJoinResolution, SyncedOptionsOverview,
|
||||
get_capabilities, get_global_options, get_initialized_options,
|
||||
SyncedOptionJoinPreview, SyncedOptionsOverview, get_capabilities,
|
||||
get_global_options, get_initialized_options,
|
||||
get_instance_option_join_preview, get_overview, get_synced_options_folder,
|
||||
reconcile_all, reconcile_changed_file, reconcile_instance,
|
||||
set_global_option, set_instance_option,
|
||||
@@ -30,3 +30,4 @@ pub(crate) use self::orchestration::{
|
||||
reconcile_instance_after_pack_update_with_state,
|
||||
remove_generated_instance_files,
|
||||
};
|
||||
pub use self::pending::SyncedOptionJoinResolution;
|
||||
Reference in new issue
Block a user