Skip to content

Commit a94c4dc

Browse files
author
root
committed
Fixes #10
1 parent bf84a63 commit a94c4dc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/Service/RecipeService.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,12 @@ public function addRecipe($json) {
434434
if(isset($json['id']) && $json['id']) {
435435
$recipe_folder = $user_folder->getById($json['id'])[0];
436436

437-
$path = $recipe_folder->getPath();
438-
$path = dirname($path) . '/' . $json['name'];
437+
$old_path = $recipe_folder->getPath();
438+
$new_path = dirname($old_path) . '/' . $json['name'];
439439

440-
$recipe_folder->move($path);
440+
if($old_path !== $new_path) {
441+
$recipe_folder->move($new_path);
442+
}
441443

442444
} else {
443445
$recipe_folder = $user_folder->get($json['name']);

0 commit comments

Comments
 (0)