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
This commit is contained in:
Carlos 2018-02-22 15:54:05 -05:00 committed by Bram van de Kerkhof
parent bf9b9ca54c
commit cf5c816483
2 changed files with 5 additions and 1 deletions

View file

@ -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<TrackImpl> {
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()
}
}
}

View file

@ -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