Fix import of older exported files

This commit is contained in:
0xb00bface 2023-11-03 21:28:28 +01:00
parent 39667ef2c9
commit 12cd5baf17
1 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package ctbrec.ui.tabs.recorded;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import ctbrec.Config;
import ctbrec.MigrateModel5_1_2;
import ctbrec.Model;
import ctbrec.ModelGroup;
import ctbrec.image.LocalPortraitStore;
@ -188,6 +189,7 @@ public class ModelImportExport {
List<Model> result = new LinkedList<>();
for (int i = 0; i < models.length(); i++) {
JSONObject model = models.getJSONObject(i);
MigrateModel5_1_2.migrate(model);
try {
ModelDto dto = mapper.readValue(model.toString(), ModelDto.class);
result.add(Mappers.getMapper(ModelMapper.class).toModel(dto));