Add migration step for model URLs, which contain spaces

This commit is contained in:
0xb00bface 2023-11-16 22:25:59 +01:00
parent 2f1ef7854a
commit 26071d59eb
2 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,8 @@
5.2.3
========================
* Fix one directory per group
* Add Stripchat tags thx to @winkru
* Fix: Loading the config failed with model URLs, which contained spaces
5.2.2
========================

View File

@ -8,8 +8,12 @@ public class MigrateModel5_1_2 {
private static final String MARKED_FOR_LATER = "markedForLater";
private static final String ADDED_TIMESTAMP = "addedTimestamp";
private static final String URL = "url";
public static void migrate(JSONObject model) {
if (model.has(URL)) {
model.put(URL, model.getString(URL).replace(" ", "%20"));
}
if (model.has(MARKED_FOR_LATER)) {
model.put("bookmarked", model.getBoolean(MARKED_FOR_LATER));
model.remove(MARKED_FOR_LATER);