tuwunel_admin/media/
mod.rs1#![expect(rustdoc::broken_intra_doc_links)]
2mod commands;
3
4use clap::Subcommand;
5use ruma::{OwnedEventId, OwnedMxcUri, OwnedServerName};
6use tuwunel_core::Result;
7
8use crate::admin_command_dispatch;
9
10#[admin_command_dispatch]
11#[derive(Debug, Subcommand)]
12pub(super) enum MediaCommand {
13 Delete {
16 #[arg(long)]
18 mxc: OwnedMxcUri,
19 },
20
21 DeleteByEvent {
23 #[arg(long)]
25 event_id: OwnedEventId,
26 },
27
28 DeleteList,
31
32 DeleteRange {
36 duration: String,
38
39 #[arg(long, short)]
41 older_than: bool,
42
43 #[arg(long, short)]
45 newer_than: bool,
46
47 #[arg(long)]
49 yes_i_want_to_delete_local_media: bool,
50 },
51
52 DeleteAllFromUser {
55 username: String,
56 },
57
58 DeleteAllFromServer {
61 server_name: OwnedServerName,
62
63 #[arg(long)]
65 yes_i_want_to_delete_local_media: bool,
66 },
67
68 GetFileInfo {
69 mxc: OwnedMxcUri,
71 },
72
73 GetRemoteFile {
74 mxc: OwnedMxcUri,
76
77 #[arg(short, long)]
78 server: Option<OwnedServerName>,
79
80 #[arg(short, long, default_value("10000"))]
81 timeout: u32,
82 },
83
84 GetRemoteThumbnail {
85 mxc: OwnedMxcUri,
87
88 #[arg(short, long)]
89 server: Option<OwnedServerName>,
90
91 #[arg(short, long, default_value("10000"))]
92 timeout: u32,
93
94 #[arg(long, default_value("800"))]
95 width: u32,
96
97 #[arg(long, default_value("800"))]
98 height: u32,
99 },
100}