diff --git a/crates/bili_sync/src/config/current.rs b/crates/bili_sync/src/config/current.rs index 226d8f3..f26e08f 100644 --- a/crates/bili_sync/src/config/current.rs +++ b/crates/bili_sync/src/config/current.rs @@ -8,11 +8,11 @@ use serde::{Deserialize, Serialize}; use validator::Validate; use crate::bilibili::{Credential, DanmakuOption, FilterOption}; -use crate::config::default::{default_auth_token, default_bind_address, default_time_format}; -use crate::config::item::{ - ConcurrentLimit, NFOTimeType, SkipOption, Trigger, default_collection_path, default_favorite_path, - default_submission_path, +use crate::config::default::{ + default_auth_token, default_bind_address, default_collection_path, default_favorite_path, default_submission_path, + default_time_format, }; +use crate::config::item::{ConcurrentLimit, NFOTimeType, SkipOption, Trigger}; use crate::notifier::Notifier; use crate::utils::model::{load_db_config, save_db_config}; diff --git a/crates/bili_sync/src/config/default.rs b/crates/bili_sync/src/config/default.rs index 92aaf28..eb8734e 100644 --- a/crates/bili_sync/src/config/default.rs +++ b/crates/bili_sync/src/config/default.rs @@ -1,9 +1,5 @@ use rand::seq::IndexedRandom; -pub(super) fn default_time_format() -> String { - "%Y-%m-%d".to_string() -} - /// 默认的 auth_token 实现,生成随机 16 位字符串 pub(super) fn default_auth_token() -> String { let byte_choices = b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-="; @@ -16,3 +12,19 @@ pub(super) fn default_auth_token() -> String { pub(crate) fn default_bind_address() -> String { "0.0.0.0:12345".to_string() } + +pub(super) fn default_time_format() -> String { + "%Y-%m-%d".to_string() +} + +pub fn default_favorite_path() -> String { + "收藏夹/{{name}}".to_owned() +} + +pub fn default_collection_path() -> String { + "合集/{{name}}".to_owned() +} + +pub fn default_submission_path() -> String { + "投稿/{{name}}".to_owned() +} diff --git a/crates/bili_sync/src/config/item.rs b/crates/bili_sync/src/config/item.rs index 4187686..9e582d2 100644 --- a/crates/bili_sync/src/config/item.rs +++ b/crates/bili_sync/src/config/item.rs @@ -98,15 +98,3 @@ impl PathSafeTemplate for handlebars::Handlebars<'_> { Ok(filenamify(&self.render(name, data)?).replace("__SEP__", std::path::MAIN_SEPARATOR_STR)) } } - -pub fn default_favorite_path() -> String { - "收藏夹/{{name}}".to_owned() -} - -pub fn default_collection_path() -> String { - "合集/{{name}}".to_owned() -} - -pub fn default_submission_path() -> String { - "投稿/{{name}}".to_owned() -}