tuwunel_admin/media/
delete_range.rs1use tuwunel_core::{Result, utils::time::parse_timepoint_ago};
2
3use crate::admin_command;
4
5#[admin_command]
6pub(super) async fn delete_range(
7 &self,
8 duration: String,
9 older_than: bool,
10 newer_than: bool,
11 yes_i_want_to_delete_local_media: bool,
12) -> Result {
13 let duration = parse_timepoint_ago(&duration)?;
14 let deleted_count = self
15 .services
16 .media
17 .delete_range(duration, older_than, newer_than, yes_i_want_to_delete_local_media)
18 .await?;
19
20 write!(self, "Deleted {deleted_count} total files.").await
21}