Refresh thumbnails after an upload or file move
This commit is contained in:
@@ -36,7 +36,7 @@ use log::{debug, error, info, warn};
|
||||
use crate::auth::login;
|
||||
use crate::data::*;
|
||||
use crate::database::*;
|
||||
use crate::files::{is_image_or_video, is_valid_full_path, move_file, RealFileSystem};
|
||||
use crate::files::{is_image_or_video, is_valid_full_path, move_file, RealFileSystem, RefreshThumbnailsMessage};
|
||||
use crate::service::ServiceBuilder;
|
||||
use crate::state::AppState;
|
||||
use crate::tags::*;
|
||||
@@ -185,8 +185,6 @@ async fn upload_image(
|
||||
|
||||
let mut file = File::create(new_path).unwrap();
|
||||
file.write_all(&file_content).unwrap();
|
||||
|
||||
return HttpResponse::Ok().finish();
|
||||
}
|
||||
} else {
|
||||
error!("Invalid path for upload: {:?}", full_path);
|
||||
@@ -196,6 +194,8 @@ async fn upload_image(
|
||||
return HttpResponse::BadRequest().body("No file body read");
|
||||
}
|
||||
|
||||
app_state.stream_manager.do_send(RefreshThumbnailsMessage);
|
||||
|
||||
HttpResponse::Ok().finish()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user