Fix init and import command

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 20f75d0983
commit ab16ba4873

@ -14,8 +14,8 @@ impl Default for Settings {
Self { Self {
listen_address: "127.0.0.1:3425".to_string(), listen_address: "127.0.0.1:3425".to_string(),
database_path: "./db/repo.db".to_string(), database_path: "./db/repo.db".to_string(),
default_file_store: "./files".to_string(), default_file_store: "Main".to_string(),
thumbnail_store: "./thumb".to_string(), thumbnail_store: "Thumbnails".to_string(),
} }
} }
} }

@ -255,7 +255,9 @@ async fn add_tags_from_tags_file(
tag_ids.push(tag.id()); tag_ids.push(tag.id());
} }
log::info!("Mapping {} tags to the file", tag_ids.len()); log::info!("Mapping {} tags to the file", tag_ids.len());
file.add_tags(tag_ids).await?; if !tag_ids.is_empty() {
file.add_tags(tag_ids).await?;
}
} else { } else {
log::info!("No tags file '{:?}' found", tags_path); log::info!("No tags file '{:?}' found", tags_path);
} }

@ -26,6 +26,10 @@ pub async fn create_paths_for_repo(root: &PathBuf, settings: &Settings) -> RepoR
if !storage_path.exists() { if !storage_path.exists() {
fs::create_dir_all(storage_path).await?; fs::create_dir_all(storage_path).await?;
} }
let thumbnail_path = root.join(&settings.thumbnail_store);
if !thumbnail_path.exists() {
fs::create_dir_all(thumbnail_path).await?;
}
Ok(()) Ok(())
} }

Loading…
Cancel
Save