diff options
author | metamuffin <metamuffin@disroot.org> | 2023-08-04 23:20:21 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-08-04 23:20:21 +0200 |
commit | 2345469bc56f5daba8ced77e49ad58f38b1c5538 (patch) | |
tree | f54a61177580ffc49e7903ccab12cf7cc5354833 /server/src | |
parent | 0a2f1d909aed3c807a30589aeca17f81c694dd37 (diff) | |
download | jellything-2345469bc56f5daba8ced77e49ad58f38b1c5538.tar jellything-2345469bc56f5daba8ced77e49ad58f38b1c5538.tar.bz2 jellything-2345469bc56f5daba8ced77e49ad58f38b1c5538.tar.zst |
fixes, set parent node correctly
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/import.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/src/import.rs b/server/src/import.rs index 374c2c7..3b45f14 100644 --- a/server/src/import.rs +++ b/server/src/import.rs @@ -55,7 +55,13 @@ pub async fn import_path( None } }); - let identifier = path.file_name().unwrap().to_str().unwrap().to_string(); + let identifier = if mpath.exists() { + path.file_name().unwrap().to_str().unwrap().to_string() + } else { + parent + .clone() + .ok_or(anyhow!("non-root node requires parent"))? + }; let all = join_all( children_paths |