From 6f2a529186050bb0f1880ae9e6d003781612fef8 Mon Sep 17 00:00:00 2001 From: doomsdayrs Date: Sat, 7 Sep 2019 10:16:12 -0400 Subject: [PATCH] Fixed chapter cast issues --- app/build.gradle | 5 +++-- .../apps/shosetsu/backend/database/Database.java | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 71fe1705b2..7e86748254 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "com.github.doomsdayrs.apps.shosetsu" minSdkVersion 22 targetSdkVersion 29 - versionCode 20 - versionName "v0.1.0" + versionCode 21 + versionName "v0.1.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true } @@ -60,6 +60,7 @@ dependencies { implementation 'com.github.Doomsdayrs:shosetsu-extensions:0.1.1' implementation 'com.github.Doomsdayrs:shosetsu-services:v0.1.1' + implementation 'com.github.Doomsdayrs:novelreader-services:1.1.4' implementation 'com.squareup.picasso:picasso:2.71828' diff --git a/app/src/main/java/com/github/doomsdayrs/apps/shosetsu/backend/database/Database.java b/app/src/main/java/com/github/doomsdayrs/apps/shosetsu/backend/database/Database.java index 25870068c8..2c5a75ef18 100644 --- a/app/src/main/java/com/github/doomsdayrs/apps/shosetsu/backend/database/Database.java +++ b/app/src/main/java/com/github/doomsdayrs/apps/shosetsu/backend/database/Database.java @@ -183,6 +183,14 @@ public static Object deserialize(String string) throws IOException, ClassNotFoun newPage.tags = oldPage.tags; newPage.title = oldPage.title; return newPage; + } else if (c.equals(com.github.Doomsdayrs.api.novelreader_core.services.core.objects.NovelChapter.class)) { + System.out.println("WARNING, OLD CHAPTER DETECTED."); + com.github.Doomsdayrs.api.novelreader_core.services.core.objects.NovelChapter C = (com.github.Doomsdayrs.api.novelreader_core.services.core.objects.NovelChapter) object; + NovelChapter newC = new NovelChapter(); + newC.chapterNum = C.chapterNum; + newC.link = C.link; + newC.release = C.release; + return newC; } return object; }