diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/src/config.rs | 2 | ||||
-rw-r--r-- | common/src/lib.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/common/src/config.rs b/common/src/config.rs index 467dc02..a9e3e0e 100644 --- a/common/src/config.rs +++ b/common/src/config.rs @@ -19,6 +19,7 @@ pub struct GlobalConfig { #[serde(default = "default::library_path")] pub library_path: PathBuf, #[serde(default = "default::cache_path")] pub cache_path: PathBuf, #[serde(default = "default::admin_username")] pub admin_username: String, + #[serde(default = "default::max_in_memory_cache_size")] pub max_in_memory_cache_size: usize, pub admin_password: String, #[serde(default)] pub cookie_key: Option<String>, #[serde(default)] pub session_key: Option<String>, @@ -37,4 +38,5 @@ mod default { pub fn database_path() -> PathBuf { "data/database".into() } pub fn library_path() -> PathBuf { "data/library".into() } pub fn cache_path() -> PathBuf { "data/cache".into() } + pub fn max_in_memory_cache_size() -> usize { 50_000_000 } } diff --git a/common/src/lib.rs b/common/src/lib.rs index 6403469..a7e1c3f 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -6,10 +6,10 @@ pub mod config; pub mod helpers; pub mod r#impl; +pub mod jhls; pub mod seek_index; pub mod stream; pub mod user; -pub mod jhls; #[cfg(feature = "rocket")] use rocket::{FromFormField, UriDisplayQuery}; @@ -56,7 +56,7 @@ pub struct RemoteImportOptions { #[serde(default)] pub prefix: Option<String>, } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Debug, Clone, Deserialize, Serialize, Hash, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum AssetLocation { Cache(PathBuf), |