initial s3 support

probably incomplete
This commit is contained in:
trinity-1686a
2023-05-12 11:30:31 +02:00
committed by Alex Auvolat
parent 9425b44d08
commit 54af93d8ff
7 changed files with 388 additions and 18 deletions
+6 -1
View File
@@ -170,7 +170,12 @@ impl Media {
pub fn delete(&self, conn: &Connection) -> Result<()> {
if !self.is_remote {
fs::remove_file(self.file_path.as_str())?;
if let Some(config) = &CONFIG.s3 {
config.get_bucket()
.delete_object_blocking(&self.file_path)?;
} else {
fs::remove_file(self.file_path.as_str())?;
}
}
diesel::delete(self)
.execute(conn)