From cf5c816483a5bc09dc311faf22703efc1fd396d9 Mon Sep 17 00:00:00 2001 From: Carlos Date: Thu, 22 Feb 2018 15:54:05 -0500 Subject: [PATCH] fix restore from old backup to updated trackimpl. (#1269) * fix restore from old backup to updated trackimpl. added backup of tracking url for new backups * assignment not needed --- .../tachiyomi/data/backup/serializer/TrackTypeAdapter.kt | 4 ++++ .../eu/kanade/tachiyomi/data/database/models/TrackImpl.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/serializer/TrackTypeAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/serializer/TrackTypeAdapter.kt index a5f43c3db2..6f01fa0233 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/serializer/TrackTypeAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/serializer/TrackTypeAdapter.kt @@ -14,6 +14,7 @@ object TrackTypeAdapter { private const val REMOTE = "r" private const val TITLE = "t" private const val LAST_READ = "l" + private const val TRACKING_URL = "u" fun build(): TypeAdapter { return typeAdapter { @@ -27,6 +28,8 @@ object TrackTypeAdapter { value(it.remote_id) name(LAST_READ) value(it.last_chapter_read) + name(TRACKING_URL) + value(it.tracking_url) endObject() } @@ -42,6 +45,7 @@ object TrackTypeAdapter { SYNC -> track.sync_id = nextInt() REMOTE -> track.remote_id = nextInt() LAST_READ -> track.last_chapter_read = nextInt() + TRACKING_URL -> track.tracking_url = nextString() } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/TrackImpl.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/TrackImpl.kt index 448aaf554d..b7c445168f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/TrackImpl.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/TrackImpl.kt @@ -20,7 +20,7 @@ class TrackImpl : Track { override var status: Int = 0 - override lateinit var tracking_url: String + override var tracking_url: String = "" override fun equals(other: Any?): Boolean { if (this === other) return true