feature/shuffle-sort #30

Merged
cameron merged 21 commits from feature/shuffle-sort into master 2024-12-06 16:25:44 +00:00
4 changed files with 856 additions and 485 deletions
Showing only changes of commit 287a61ae3f - Show all commits

1287
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,26 +14,26 @@ actix = "0.13.1"
actix-web = "4"
actix-rt = "2.6"
actix-files = "0.6"
actix-multipart = "0.6.1"
actix-multipart = "0.7.2"
futures = "0.3.5"
jsonwebtoken = "9.2.0"
jsonwebtoken = "9.3.0"
serde = "1"
serde_json = "1"
diesel = { version = "2.0.2", features = ["sqlite"] }
diesel = { version = "2.2.5", features = ["sqlite"] }
diesel_migrations = "2.0.0"
hmac = "0.12.1"
sha2 = "0.10.8"
chrono = "0.4"
dotenv = "0.15"
bcrypt = "0.15.0"
image = { version = "0.24.7", default-features = false, features = ["jpeg", "png", "jpeg_rayon"] }
bcrypt = "0.16.0"
image = { version = "0.24.9", default-features = false, features = ["jpeg", "png", "jpeg_rayon"] }
walkdir = "2.4.0"
rayon = "1.5"
notify = "6.1.1"
path-absolutize = "3.0"
path-absolutize = "3.1"
log="0.4"
env_logger= "0.10.1"
actix-web-prom = "0.7.0"
env_logger= "0.11.5"
actix-web-prom = "0.9.0"
prometheus = "0.13"
lazy_static = "1.1"
lazy_static = "1.5"
anyhow = "1.0"

View File

@@ -314,7 +314,7 @@ impl Handler<RefreshThumbnailsMessage> for StreamActor {
type Result = ();
fn handle(&mut self, _msg: RefreshThumbnailsMessage, _ctx: &mut Self::Context) -> Self::Result {
debug!("Refreshing thumbnails after upload");
info!("Refreshing thumbnails after upload");
create_thumbnails()
}
}

View File

@@ -26,6 +26,7 @@ use actix_web::{
web::{self, BufMut, BytesMut},
App, HttpRequest, HttpResponse, HttpServer, Responder,
};
use anyhow::Context;
use chrono::Utc;
use diesel::sqlite::Sqlite;
use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
@@ -139,7 +140,7 @@ async fn upload_image(
let mut file_path: Option<String> = None;
while let Some(Ok(mut part)) = payload.next().await {
let content_type = part.content_disposition();
if let Some(content_type) = part.content_disposition() {
debug!("{:?}", content_type);
if let Some(filename) = content_type.get_filename() {
debug!("Name: {:?}", filename);
@@ -156,6 +157,7 @@ async fn upload_image(
}
}
}
}
let path = file_path.unwrap_or_else(|| app_state.base_path.clone());
if !file_content.is_empty() {
@@ -462,7 +464,9 @@ fn is_video(entry: &DirEntry) -> bool {
}
fn main() -> std::io::Result<()> {
dotenv::dotenv().ok();
if let Err(err) = dotenv::dotenv() {
println!("Error parsing .env {:?}", err);
}
env_logger::init();
run_migrations(&mut connect()).expect("Failed to run migrations");
@@ -544,7 +548,9 @@ fn watch_files() {
let base_str = dotenv::var("BASE_PATH").unwrap();
let base_path = Path::new(&base_str);
watcher.watch(base_path, RecursiveMode::Recursive).unwrap();
watcher.watch(base_path, RecursiveMode::Recursive)
.context(format!("Unable to watch BASE_PATH: '{}'", base_str))
.unwrap();
loop {
let ev = wrx.recv();