Forgotten fixes

This commit is contained in:
Alexander
2026-05-18 13:31:31 +02:00
parent b88583707d
commit 4a1b68981e
4 changed files with 588 additions and 10 deletions
+4 -4
View File
@@ -1,6 +1,8 @@
use musicfs_cache::{Database, VirtualTree};
use musicfs_cas::ContentFetcher;
use musicfs_core::{AudioMeta, Error, Event, EventBus, FileId, FileMeta, OriginId, RealPath, Result, VirtualPath};
use musicfs_core::{
AudioMeta, Error, Event, EventBus, FileId, FileMeta, OriginId, RealPath, Result, VirtualPath,
};
use musicfs_metadata::MetadataParser;
use parking_lot::RwLock;
use std::path::{Path, PathBuf};
@@ -101,9 +103,7 @@ impl OriginScanner {
continue;
}
let size = std::fs::metadata(abs_path)
.map(|m| m.len())
.unwrap_or(0);
let size = std::fs::metadata(abs_path).map(|m| m.len()).unwrap_or(0);
new_files.push(DiscoveredFile {
abs_path: abs_path.clone(),
+4 -1
View File
@@ -529,7 +529,10 @@ mod tests {
let store = Arc::new(musicfs_cas::CasStore::open(cfg).await.unwrap());
let fetcher = Arc::new(musicfs_cas::ContentFetcher::new(store));
let origin_root = std::path::PathBuf::from("/tmp/test-origin");
(MusicFsServer::new(event_bus, db, tree, fetcher, origin_root), dir)
(
MusicFsServer::new(event_bus, db, tree, fetcher, origin_root),
dir,
)
}
#[tokio::test]