From 91e167940ca299c228c9de973487b1978d2e550d Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 01:33:11 +0100 Subject: config: harden the shared temp directory --- src/commands/utilities.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/commands') diff --git a/src/commands/utilities.rs b/src/commands/utilities.rs index 88829b2..f43b30e 100644 --- a/src/commands/utilities.rs +++ b/src/commands/utilities.rs @@ -100,7 +100,7 @@ async fn temp_op( .unwrap_or_default(); let dir = format!( "{}/op_{}", - crate::config::TEMP_PATH, + crate::config::temp_path(), uuid::Uuid::new_v4() ); tokio::fs::create_dir_all(&dir).await?; @@ -506,7 +506,7 @@ async fn run_download( } let fmt = fformat.unwrap_or("mp4"); let is_audio = matches!(fmt, "mp3" | "wav" | "m4a"); - let dl_dir = format!("{}/dl_{}", crate::config::TEMP_PATH, uuid::Uuid::new_v4()); + let dl_dir = format!("{}/dl_{}", crate::config::temp_path(), uuid::Uuid::new_v4()); tokio::fs::create_dir_all(&dl_dir).await.ok(); let out_template = match filename_user { @@ -651,7 +651,7 @@ pub async fn compress( #[description = "Force upload to Copyparty"] serwer: Option, ) -> Result<()> { ctx.defer().await?; - tokio::fs::create_dir_all(crate::config::TEMP_PATH) + tokio::fs::create_dir_all(crate::config::temp_path()) .await .ok(); @@ -727,7 +727,7 @@ pub async fn convert( #[description = "Force upload to Copyparty"] serwer: Option, ) -> Result<()> { ctx.defer().await?; - tokio::fs::create_dir_all(crate::config::TEMP_PATH) + tokio::fs::create_dir_all(crate::config::temp_path()) .await .ok(); @@ -899,7 +899,7 @@ pub async fn download( #[description = "Custom output filename"] filename_user: Option, ) -> Result<()> { ctx.defer().await?; - tokio::fs::create_dir_all(crate::config::TEMP_PATH) + tokio::fs::create_dir_all(crate::config::temp_path()) .await .ok(); run_download( @@ -974,7 +974,7 @@ pub async fn message_compression(ctx: Context<'_>, message: serenity::Message) - return Ok(()); } ctx.defer().await?; - tokio::fs::create_dir_all(crate::config::TEMP_PATH) + tokio::fs::create_dir_all(crate::config::temp_path()) .await .ok(); @@ -1030,7 +1030,7 @@ pub async fn message_download(ctx: Context<'_>, message: serenity::Message) -> R return Ok(()); } ctx.defer().await?; - tokio::fs::create_dir_all(crate::config::TEMP_PATH) + tokio::fs::create_dir_all(crate::config::temp_path()) .await .ok(); -- cgit v1.2.3