add migrations

This commit is contained in:
hamidreza kalbasi
2021-06-09 22:22:05 +02:00
committed by Timo Kösters
parent affa124864
commit 2385bd1cfd
2 changed files with 25 additions and 10 deletions
+3 -3
View File
@@ -103,7 +103,7 @@ pub async fn get(&self, globals: &Globals, mxc: &str) -> Result<Option<FileMeta>
let mut iter = self.mediaid_file.scan_prefix(prefix);
if let Some((key, _)) = iter.next() {
let path = globals.get_media_file(&key);
let mut file = vec![];
let mut file = Vec::new();
File::open(path).await?.read_to_end(&mut file).await?;
let mut parts = key.rsplit(|&b| b == 0xff);
@@ -192,7 +192,7 @@ pub async fn get_thumbnail(
if let Some((key, _)) = self.mediaid_file.scan_prefix(thumbnail_prefix).next() {
// Using saved thumbnail
let path = globals.get_media_file(&key);
let mut file = vec![];
let mut file = Vec::new();
File::open(path).await?.read_to_end(&mut file).await?;
let mut parts = key.rsplit(|&b| b == 0xff);
@@ -227,7 +227,7 @@ pub async fn get_thumbnail(
} else if let Some((key, _)) = self.mediaid_file.scan_prefix(original_prefix).next() {
// Generate a thumbnail
let path = globals.get_media_file(&key);
let mut file = vec![];
let mut file = Vec::new();
File::open(path).await?.read_to_end(&mut file).await?;
let mut parts = key.rsplit(|&b| b == 0xff);