From 5ee19df98c3845c5643245f5d5ed041fe0dc718d Mon Sep 17 00:00:00 2001 From: TobiGr Date: Thu, 19 Oct 2023 11:38:39 +0200 Subject: [PATCH] Update new version check to match new API structure See TeamNewPipe/web-api#17 --- .../main/java/org/schabi/newpipe/NewVersionWorker.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/NewVersionWorker.kt b/app/src/main/java/org/schabi/newpipe/NewVersionWorker.kt index c46dd63488a..39d8e90dcdc 100644 --- a/app/src/main/java/org/schabi/newpipe/NewVersionWorker.kt +++ b/app/src/main/java/org/schabi/newpipe/NewVersionWorker.kt @@ -120,13 +120,13 @@ class NewVersionWorker( // Parse the json from the response. try { - val githubStableObject = JsonParser.`object`() + val newpipeVersionInfo = JsonParser.`object`() .from(response.responseBody()).getObject("flavors") - .getObject("github").getObject("stable") + .getObject("newpipe") - val versionName = githubStableObject.getString("version") - val versionCode = githubStableObject.getInt("version_code") - val apkLocationUrl = githubStableObject.getString("apk") + val versionName = newpipeVersionInfo.getString("version") + val versionCode = newpipeVersionInfo.getInt("version_code") + val apkLocationUrl = newpipeVersionInfo.getString("apk") compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode) } catch (e: JsonParserException) { // Most likely something is wrong in data received from NEWPIPE_API_URL.