From cec3c467cf617aaf7cd45ace0c4b0226d78b2fa0 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Wed, 11 Nov 2020 21:59:05 +0100 Subject: [PATCH 1/2] Accept null value for Nextcloud News feed attribute folderId. Fixes #87 --- .../services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt | 5 +++-- .../main/java/com/readrops/api/utils/JsonReaderExtensions.kt | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt index 4bfc3832..16ad2e79 100644 --- a/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt +++ b/api/src/main/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsFeedsAdapter.kt @@ -1,6 +1,7 @@ package com.readrops.api.services.nextcloudnews.adapters import android.annotation.SuppressLint +import com.readrops.api.utils.nextNullableInt import com.readrops.db.entities.Feed import com.readrops.api.utils.nextNullableString import com.squareup.moshi.FromJson @@ -43,8 +44,8 @@ class NextNewsFeedsAdapter { 2 -> name = reader.nextString() 3 -> iconUrl = reader.nextString() 4 -> { - val nextInt = reader.nextInt() - remoteFolderId = if (nextInt > 0) nextInt.toString() else null + val nextInt = reader.nextNullableInt() + remoteFolderId = if (nextInt != null && nextInt > 0) nextInt.toString() else null } 5 -> siteUrl = reader.nextNullableString() else -> reader.skipValue() diff --git a/api/src/main/java/com/readrops/api/utils/JsonReaderExtensions.kt b/api/src/main/java/com/readrops/api/utils/JsonReaderExtensions.kt index ae8e4bde..f03553cb 100644 --- a/api/src/main/java/com/readrops/api/utils/JsonReaderExtensions.kt +++ b/api/src/main/java/com/readrops/api/utils/JsonReaderExtensions.kt @@ -3,4 +3,7 @@ package com.readrops.api.utils import com.squareup.moshi.JsonReader fun JsonReader.nextNullableString(): String? = - if (peek() != JsonReader.Token.NULL) nextString() else nextNull() \ No newline at end of file + if (peek() != JsonReader.Token.NULL) nextString() else nextNull() + +fun JsonReader.nextNullableInt(): Int? = + if (peek() != JsonReader.Token.NULL) nextInt() else nextNull() \ No newline at end of file From 1ef9757aafd98db0614d8ae7ad4c56717a22a2c2 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sun, 22 Nov 2020 18:43:43 +0100 Subject: [PATCH 2/2] Bump app version and add changelog --- CHANGELOG.md | 7 ++++++- app/build.gradle | 4 ++-- fastlane/metadata/android/en-US/changelogs/12.txt | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/12.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index d110403e..fe69f5a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -#v1.2.0 +# v1.2.1 + +- Accept null value for Nextcloud News feed attribute folderId #87 +- Fix local RSS url parsing + +# v1.2.0 - Adaptive icon - Background synchronisation diff --git a/app/build.gradle b/app/build.gradle index 4655cf7b..c3217697 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion - versionCode 11 - versionName "1.2.0" + versionCode 12 + versionName "1.2.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } testOptions { diff --git a/fastlane/metadata/android/en-US/changelogs/12.txt b/fastlane/metadata/android/en-US/changelogs/12.txt new file mode 100644 index 00000000..1622551b --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/12.txt @@ -0,0 +1,4 @@ +