From 94443e763cb4c5b8a06426bca0caa67f70de8c0b Mon Sep 17 00:00:00 2001 From: acegoal07 <39467245+acegoal07@users.noreply.github.com> Date: Wed, 22 May 2024 00:13:06 +0100 Subject: [PATCH] Update nfc_playlist_scene_file_rename.c --- scenes/nfc_playlist_scene_file_rename.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scenes/nfc_playlist_scene_file_rename.c b/scenes/nfc_playlist_scene_file_rename.c index f90dfaf8d68..29522931a6d 100644 --- a/scenes/nfc_playlist_scene_file_rename.c +++ b/scenes/nfc_playlist_scene_file_rename.c @@ -12,12 +12,17 @@ void nfc_playlist_file_rename_menu_callback(void* context) { furi_string_cat_str(new_file_path, ".txt"); char const* new_file_path_cstr = furi_string_get_cstr(new_file_path); - if(!storage_file_exists(storage, new_file_path_cstr)) { - storage_common_rename(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr); + if (storage_common_rename_safe(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr) == 0) { furi_string_free(nfc_playlist->settings.file_path); nfc_playlist->settings.file_path = furi_string_alloc_set_str(new_file_path_cstr); } + // if (!storage_file_exists(storage, new_file_path_cstr)) { + // storage_common_rename(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr); + // furi_string_free(nfc_playlist->settings.file_path); + // nfc_playlist->settings.file_path = furi_string_alloc_set_str(new_file_path_cstr); + // } + furi_record_close(RECORD_STORAGE); furi_string_free(new_file_path);