feat: media API (video/bbox/thumbnail), UUID unification, dot matrix text, portal fixes, API dictionary V1.3

This commit is contained in:
Warren
2026-05-06 13:34:49 +08:00
parent e75c4d6f07
commit 74b6182eba
197 changed files with 17511 additions and 8759 deletions

View File

@@ -165,42 +165,6 @@ pub mod cache {
});
}
pub mod snapshot {
use super::*;
pub static SNAPSHOT_DIR_NAME: Lazy<String> = Lazy::new(|| {
env::var("MOMENTRY_SNAPSHOT_DIR_NAME").unwrap_or_else(|_| ".momentry_snapshots".to_string())
});
pub static HOT_THRESHOLD: Lazy<u64> = Lazy::new(|| {
env::var("MOMENTRY_SNAPSHOT_HOT_THRESHOLD")
.unwrap_or_else(|_| "5".to_string())
.parse()
.unwrap_or(5)
});
pub static HOT_TTL_SECS: Lazy<u64> = Lazy::new(|| {
env::var("MOMENTRY_SNAPSHOT_HOT_TTL_SECS")
.unwrap_or_else(|_| "86400".to_string())
.parse()
.unwrap_or(86400)
});
pub static WARM_TTL_SECS: Lazy<u64> = Lazy::new(|| {
env::var("MOMENTRY_SNAPSHOT_WARM_TTL_SECS")
.unwrap_or_else(|_| "604800".to_string())
.parse()
.unwrap_or(604800)
});
pub static GENERATING_TIMEOUT_SECS: Lazy<u64> = Lazy::new(|| {
env::var("MOMENTRY_SNAPSHOT_GENERATING_TIMEOUT")
.unwrap_or_else(|_| "1800".to_string())
.parse()
.unwrap_or(1800)
});
}
pub mod llm {
use super::*;
@@ -226,3 +190,15 @@ pub mod llm {
.unwrap_or(true)
});
}
pub mod tmdb {
use super::*;
pub static API_KEY: Lazy<Option<String>> = Lazy::new(|| env::var("TMDB_API_KEY").ok());
pub static PROBE_ENABLED: Lazy<bool> = Lazy::new(|| {
env::var("MOMENTRY_TMDB_PROBE_ENABLED")
.map(|v| v == "true" || v == "1")
.unwrap_or(false)
});
}