Skip to content

Commit

Permalink
Update nfc_playlist_scene_file_rename.c
Browse files Browse the repository at this point in the history
  • Loading branch information
acegoal07 committed May 21, 2024
1 parent 198b9ce commit 94443e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scenes/nfc_playlist_scene_file_rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 94443e7

Please sign in to comment.