Add tracing to file retrieval command

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 144b95dcfd
commit 52aa9d4f20

@ -1,6 +1,6 @@
[package]
name = "mediarepo-api"
version = "0.5.2"
version = "0.5.3"
edition = "2018"
license = "gpl-3"

@ -130,6 +130,7 @@ pub async fn resolve_paths_to_files(paths: Vec<String>) -> PluginResult<Vec<File
}
/// Resolves a path into several file metadata objects
#[tracing::instrument(level = "debug")]
async fn resolve_path_to_files(path: PathBuf) -> PluginResult<Vec<FileOSMetadata>> {
let mut files = Vec::new();
@ -152,6 +153,7 @@ async fn resolve_path_to_files(path: PathBuf) -> PluginResult<Vec<FileOSMetadata
}
/// Iteratively resolves a directory into its sub components
#[tracing::instrument(level = "debug")]
async fn resolve_subdir(entry: DirEntry) -> PluginResult<Vec<DirEntry>> {
let mut entries = vec![entry];
@ -171,6 +173,7 @@ async fn resolve_subdir(entry: DirEntry) -> PluginResult<Vec<DirEntry>> {
/// Retrieves information about a path that MUST be a file and returns
/// metadata for it
#[tracing::instrument(level = "trace")]
async fn retrieve_file_information(path: PathBuf) -> PluginResult<FileOSMetadata> {
let mime = mime_guess::from_path(&path)
.first()

Loading…
Cancel
Save