add interface to get file metadata w/ admin command
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
e7b2c14280
commit
7b0e830f4c
3 changed files with 27 additions and 2 deletions
|
@ -257,3 +257,11 @@ pub(super) async fn delete_all_from_server(
|
|||
"Deleted {deleted_count} total files.",
|
||||
)))
|
||||
}
|
||||
|
||||
#[admin_command]
|
||||
pub(super) async fn get_file_info(&self, mxc: OwnedMxcUri) -> Result<RoomMessageEventContent> {
|
||||
let mxc: Mxc<'_> = mxc.as_str().try_into()?;
|
||||
let metadata = self.services.media.get_metadata(&mxc);
|
||||
|
||||
Ok(RoomMessageEventContent::notice_markdown(format!("```\n{metadata:#?}\n```")))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue