fix: remove unused config item

This commit is contained in:
Xinrea
2025-09-22 23:39:46 +08:00
parent 2d1021bc42
commit b655e98f35
6 changed files with 0 additions and 64 deletions

View File

@@ -10,9 +10,6 @@ whisper_model = "./whisper_model.bin"
whisper_prompt = "这是一段中文 你们好"
openai_api_key = ""
clip_name_format = "[{room_id}][{live_id}][{title}][{created_at}].mp4"
# FLV 转换后自动清理源文件
# 启用后,导入 FLV 视频并自动转换为 MP4 后,会删除原始 FLV 文件以节省存储空间
cleanup_source_flv_after_import = false
[auto_generate]
enabled = false

View File

@@ -35,8 +35,6 @@ pub struct Config {
pub config_path: String,
#[serde(default = "default_whisper_language")]
pub whisper_language: String,
#[serde(default = "default_cleanup_source_flv")]
pub cleanup_source_flv_after_import: bool,
#[serde(default = "default_webhook_url")]
pub webhook_url: String,
}
@@ -90,10 +88,6 @@ fn default_whisper_language() -> String {
"auto".to_string()
}
fn default_cleanup_source_flv() -> bool {
false
}
fn default_webhook_url() -> String {
String::new()
}
@@ -135,7 +129,6 @@ impl Config {
status_check_interval: default_status_check_interval(),
config_path: config_path.to_str().unwrap().into(),
whisper_language: default_whisper_language(),
cleanup_source_flv_after_import: default_cleanup_source_flv(),
webhook_url: default_webhook_url(),
};
@@ -169,12 +162,6 @@ impl Config {
self.save();
}
#[allow(dead_code)]
pub fn set_cleanup_source_flv(&mut self, cleanup: bool) {
self.cleanup_source_flv_after_import = cleanup;
self.save();
}
pub fn generate_clip_name(&self, params: &ClipRangeParams) -> PathBuf {
let platform = PlatformType::from_str(&params.platform).unwrap();

View File

@@ -266,14 +266,6 @@ pub async fn update_whisper_language(
Ok(())
}
#[cfg_attr(feature = "gui", tauri::command)]
#[cfg(feature = "gui")]
pub async fn update_cleanup_source_flv(state: state_type!(), cleanup: bool) -> Result<(), ()> {
log::info!("Updating cleanup source FLV after import to {cleanup}");
state.config.write().await.set_cleanup_source_flv(cleanup);
Ok(())
}
#[cfg_attr(feature = "gui", tauri::command)]
pub async fn update_webhook_url(state: state_type!(), webhook_url: String) -> Result<(), ()> {
log::info!("Updating webhook url to {webhook_url}");

View File

@@ -561,7 +561,6 @@ fn setup_invoke_handlers(builder: tauri::Builder<tauri::Wry>) -> tauri::Builder<
crate::handlers::config::update_auto_generate,
crate::handlers::config::update_status_check_interval,
crate::handlers::config::update_whisper_language,
crate::handlers::config::update_cleanup_source_flv,
crate::handlers::config::update_webhook_url,
crate::handlers::message::get_messages,
crate::handlers::message::read_message,

View File

@@ -137,7 +137,6 @@ export interface Config {
auto_generate: AutoGenerateConfig;
status_check_interval: number;
whisper_language: string;
cleanup_source_flv_after_import: boolean;
webhook_url: string;
}

View File

@@ -37,7 +37,6 @@
},
status_check_interval: 30, // 默认30秒
whisper_language: "",
cleanup_source_flv_after_import: false,
webhook_url: "",
};
@@ -143,12 +142,6 @@
});
}
async function update_cleanup_source_flv() {
await invoke("update_cleanup_source_flv", {
cleanup: setting_model.cleanup_source_flv_after_import,
});
}
async function update_webhook_url() {
await invoke("update_webhook_url", {
webhookUrl: setting_model.webhook_url,
@@ -344,37 +337,6 @@
</button>
</div>
</div>
<!-- FLV Auto-cleanup Setting -->
<div class="p-4">
<div class="flex items-center justify-between">
<div>
<h3
class="text-sm font-medium text-gray-900 dark:text-white"
>
FLV 转换后自动清理源文件
</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">
启用后,自动识别目录导入 FLV 视频并自动转换为 MP4
后,会删除原始 FLV 文件以节省存储空间
</p>
</div>
<label
class="relative inline-flex items-center cursor-pointer"
>
<input
type="checkbox"
bind:checked={
setting_model.cleanup_source_flv_after_import
}
on:change={update_cleanup_source_flv}
class="sr-only peer"
/>
<div
class="w-11 h-6 bg-gray-200 dark:bg-gray-700 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"
></div>
</label>
</div>
</div>
</div>
</div>
{/if}