diff --git a/applications/main/archive/helpers/archive_favorites.c b/applications/main/archive/helpers/archive_favorites.c index c7b058235..799b29034 100644 --- a/applications/main/archive/helpers/archive_favorites.c +++ b/applications/main/archive/helpers/archive_favorites.c @@ -112,7 +112,9 @@ static bool archive_favourites_rescan() { furi_string_free(buffer); storage_file_close(file); - storage_common_move(storage, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH); + if(storage_common_move(storage, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) { + storage_common_remove(storage, ARCHIVE_FAV_PATH); + } storage_file_free(file); furi_record_close(RECORD_STORAGE); @@ -215,7 +217,9 @@ bool archive_favorites_delete(const char* format, ...) { furi_string_free(filename); storage_file_close(file); - storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH); + if(storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) { + storage_common_remove(fs_api, ARCHIVE_FAV_PATH); + } storage_file_free(file); furi_record_close(RECORD_STORAGE); @@ -298,7 +302,9 @@ bool archive_favorites_rename(const char* src, const char* dst) { furi_string_free(path); storage_file_close(file); - storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH); + if(storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) { + storage_common_remove(fs_api, ARCHIVE_FAV_PATH); + } storage_file_free(file); furi_record_close(RECORD_STORAGE); @@ -324,7 +330,9 @@ void archive_favorites_save(void* context) { archive_file_append(ARCHIVE_FAV_TEMP_PATH, "%s\n", furi_string_get_cstr(item->path)); } - storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH); + if(storage_common_move(fs_api, ARCHIVE_FAV_TEMP_PATH, ARCHIVE_FAV_PATH) == FSE_NOT_EXIST) { + storage_common_remove(fs_api, ARCHIVE_FAV_PATH); + } storage_file_free(file); furi_record_close(RECORD_STORAGE);