temp daily mix fix
This commit is contained in:
@@ -46,6 +46,7 @@ public class CatalogJsonInjector {
|
|||||||
var blocks = oldItems.optJSONObject(0).optJSONArray("blocks");
|
var blocks = oldItems.optJSONObject(0).optJSONArray("blocks");
|
||||||
|
|
||||||
if (!useOldAppVer) {
|
if (!useOldAppVer) {
|
||||||
|
fixDailyMix(blocks);
|
||||||
if (blocks != null) {
|
if (blocks != null) {
|
||||||
for (int i = 0; i < blocks.length(); i++) {
|
for (int i = 0; i < blocks.length(); i++) {
|
||||||
var block = blocks.optJSONObject(i);
|
var block = blocks.optJSONObject(i);
|
||||||
@@ -273,6 +274,23 @@ public class CatalogJsonInjector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Fix pictures
|
||||||
|
public static void fixDailyMix(JSONArray blocks) {
|
||||||
|
if (blocks == null) return;
|
||||||
|
for (int i = 0; i < blocks.length(); i++) {
|
||||||
|
var block = blocks.optJSONObject(i);
|
||||||
|
var layout = block.optJSONObject("layout");
|
||||||
|
if (layout == null) continue;
|
||||||
|
var name = layout.optString("name");
|
||||||
|
if (!name.equals("recomms_slider")) continue;
|
||||||
|
try {
|
||||||
|
layout.put("name", "large_slider");
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static JSONObject fetchCatalogId(String section) {
|
private static JSONObject fetchCatalogId(String section) {
|
||||||
if (section.isEmpty()) return null;
|
if (section.isEmpty()) return null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user