From 8059743e0b8130e1b6c4fdfc457977a757833404 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Tue, 19 Jul 2022 20:58:30 +0300 Subject: [PATCH] added playlists --- .../java/ru/vtosters/lite/hooks/JsonInjectors.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java b/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java index 9fb4484f9..0b55b5fb7 100644 --- a/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java +++ b/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java @@ -135,6 +135,17 @@ public class JsonInjectors{ var oldItems = json.optJSONObject("catalog").optJSONArray("sections"); if (oldItems != null) { + var playlists = fetchCatalogId("https://vk.com/audio?section=my_playlists"); + if (playlists != null) { + var catalogarr = playlists.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0); + + var title = catalogarr.optString("title"); + var id = catalogarr.optString("id"); + var url = catalogarr.optString("url"); + + oldItems.put(new JSONObject().put("id", id).put("title", title).put("url", url)); + } + var albums = fetchCatalogId("https://vk.com/audio?section=albums"); if (albums != null) { var catalogarr = albums.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0); @@ -147,7 +158,7 @@ public class JsonInjectors{ } var recent = fetchCatalogId("https://vk.com/audio?section=recent"); - if (albums != null) { + if (recent != null) { var catalogarr = recent.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0); var title = catalogarr.optString("title");