diff --git a/radio/src/storage/modelslist.cpp b/radio/src/storage/modelslist.cpp index 5936df294..9e7a88082 100644 --- a/radio/src/storage/modelslist.cpp +++ b/radio/src/storage/modelslist.cpp @@ -352,8 +352,17 @@ bool ModelsList::loadYaml() { char line[LEN_MODELS_IDX_LINE+1]; FRESULT result = f_open(&file, MODELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); + if (result != FR_OK) { - result = f_open(&file, FALLBACK_MODELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); + // move the YaML models list from the old to the new place + FILINFO fno; + if (f_stat(FALLBACK_MODELSLIST_YAML_PATH, &fno) == FR_OK) { + if (!sdCopyFile(FALLBACK_MODELSLIST_YAML_PATH, MODELSLIST_YAML_PATH)) { + f_unlink(FALLBACK_MODELSLIST_YAML_PATH); + result = + f_open(&file, MODELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); + } + } } if (result == FR_OK) {