media: use FileMeta instead of tuples

This commit is contained in:
Lambda 2024-08-11 17:19:12 +00:00
parent 1ccb1e572b
commit a4b7df1b3a
4 changed files with 50 additions and 76 deletions

View file

@ -1,4 +1,4 @@
use super::MediaFileKey;
use super::{FileMeta, MediaFileKey};
use crate::Result;
pub(crate) trait Data: Send + Sync {
@ -7,15 +7,13 @@ pub(crate) trait Data: Send + Sync {
mxc: String,
width: u32,
height: u32,
content_disposition: Option<&str>,
content_type: Option<&str>,
meta: &FileMeta,
) -> Result<MediaFileKey>;
/// Returns `content_disposition`, `content_type` and the `metadata` key.
fn search_file_metadata(
&self,
mxc: String,
width: u32,
height: u32,
) -> Result<(Option<String>, Option<String>, MediaFileKey)>;
) -> Result<(FileMeta, MediaFileKey)>;
}