From 7e520e9bedb9a874172ddae3834fffc61b02dcf4 Mon Sep 17 00:00:00 2001 From: Amine Date: Mon, 5 Nov 2018 21:11:25 +0100 Subject: [PATCH] Still fixing selfoss version issues. --- .../main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt | 4 ++++ .../amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt | 2 +- .../bou/readerforselfoss/utils/persistence/EntitiesUtils.kt | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt index e667cdc..3f1baee 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt @@ -735,6 +735,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { } override fun onFailure(call: Call>?, t: Throwable?) { + val apiDrawerData = DrawerData(tags, null) + if ((maybeDrawerData != null && maybeDrawerData != apiDrawerData) || maybeDrawerData == null) { + handleDrawerData(apiDrawerData) + } } }) } diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt index 78cee13..dc12756 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt @@ -45,7 +45,7 @@ data class Spout( data class Source( @SerializedName("id") val id: String, @SerializedName("title") val title: String, - @SerializedName("tags") val tags: String, + @SerializedName("tags") val tags: SelfossTagType, @SerializedName("spout") val spout: String, @SerializedName("error") val error: String, @SerializedName("icon") val icon: String diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/utils/persistence/EntitiesUtils.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/utils/persistence/EntitiesUtils.kt index 31406e9..9e1a315 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/utils/persistence/EntitiesUtils.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/utils/persistence/EntitiesUtils.kt @@ -19,7 +19,7 @@ fun SourceEntity.toView(): Source = Source( this.id, this.title, - this.tags, + SelfossTagType(this.tags), this.spout, this.error, this.icon @@ -29,7 +29,7 @@ fun Source.toEntity(): SourceEntity = SourceEntity( this.id, this.title, - this.tags, + this.tags.tags, this.spout, this.error, this.icon.orEmpty()