add admin command to delete all remote media files

This commit is contained in:
Benjamin Lee 2024-09-15 00:34:20 -07:00
parent d7087c66bb
commit 9d14c5d461
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4
4 changed files with 98 additions and 2 deletions

View file

@ -141,6 +141,15 @@ impl Service {
Ok(())
}
/// List all media stored in the database.
///
/// Each MXC is list once. Thumbnails are not included separately from the
/// original media.
#[tracing::instrument(skip(self))]
pub(crate) fn iter_all(&self) -> impl Iterator<Item = Result<OwnedMxcUri>> {
self.db.all_file_metadata().map(|media| media.map(|(mxc, ..)| mxc))
}
/// Returns width, height of the thumbnail and whether it should be cropped.
/// Returns None when the server should send the original file.
fn thumbnail_properties(