use crate::{
db::{Db, MediaMeta},
error::Error,
};
use activitystreams::iri_string::types::IriString;
use actix_web::web::Bytes;
use std::time::{Duration, SystemTime};
use uuid::Uuid;
static MEDIA_DURATION: Duration = Duration::from_secs(60 * 60 * 24 * 2);
#[derive(Clone, Debug)]
pub struct MediaCache {
db: Db,
}
impl MediaCache {
pub(crate) fn new(db: Db) -> Self {
MediaCache { db }
}
#[tracing::instrument(level = "debug", name = "Get media uuid", skip_all, fields(url = url.to_string().as_str()))]
pub(crate) async fn get_uuid(&self, url: IriString) -> Result