Backup and restore total seconds of an episode (#555)

* fix restoring backup for seen anime

* fix bottom bar when selecting anime in library

* Backup and restore "total seconds" of an episode
This commit is contained in:
Quickdesh 2022-04-29 20:06:45 +09:00 committed by GitHub
parent c5f6eb3541
commit 50eaf8087f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View file

@ -16,6 +16,7 @@ data class BackupEpisode(
@ProtoNumber(5) var bookmark: Boolean = false, @ProtoNumber(5) var bookmark: Boolean = false,
// lastPageRead is called progress in 1.x // lastPageRead is called progress in 1.x
@ProtoNumber(6) var lastSecondSeen: Long = 0, @ProtoNumber(6) var lastSecondSeen: Long = 0,
@ProtoNumber(16) var totalSeconds: Long = 0,
@ProtoNumber(7) var dateFetch: Long = 0, @ProtoNumber(7) var dateFetch: Long = 0,
@ProtoNumber(8) var dateUpload: Long = 0, @ProtoNumber(8) var dateUpload: Long = 0,
// episodeNumber is called number is 1.x // episodeNumber is called number is 1.x
@ -31,6 +32,7 @@ data class BackupEpisode(
seen = this@BackupEpisode.seen seen = this@BackupEpisode.seen
bookmark = this@BackupEpisode.bookmark bookmark = this@BackupEpisode.bookmark
last_second_seen = this@BackupEpisode.lastSecondSeen last_second_seen = this@BackupEpisode.lastSecondSeen
total_seconds = this@BackupEpisode.totalSeconds
date_fetch = this@BackupEpisode.dateFetch date_fetch = this@BackupEpisode.dateFetch
date_upload = this@BackupEpisode.dateUpload date_upload = this@BackupEpisode.dateUpload
source_order = this@BackupEpisode.sourceOrder source_order = this@BackupEpisode.sourceOrder
@ -47,6 +49,7 @@ data class BackupEpisode(
seen = episode.seen, seen = episode.seen,
bookmark = episode.bookmark, bookmark = episode.bookmark,
lastSecondSeen = episode.last_second_seen, lastSecondSeen = episode.last_second_seen,
totalSeconds = episode.total_seconds,
dateFetch = episode.date_fetch, dateFetch = episode.date_fetch,
dateUpload = episode.date_upload, dateUpload = episode.date_upload,
sourceOrder = episode.source_order, sourceOrder = episode.source_order,

View file

@ -30,5 +30,6 @@ class EpisodeBackupPutResolver : PutResolver<Episode>() {
EpisodeTable.COL_SEEN to episode.seen, EpisodeTable.COL_SEEN to episode.seen,
EpisodeTable.COL_BOOKMARK to episode.bookmark, EpisodeTable.COL_BOOKMARK to episode.bookmark,
EpisodeTable.COL_LAST_SECOND_SEEN to episode.last_second_seen, EpisodeTable.COL_LAST_SECOND_SEEN to episode.last_second_seen,
EpisodeTable.COL_TOTAL_SECONDS to episode.total_seconds,
) )
} }

View file

@ -30,5 +30,6 @@ class EpisodeKnownBackupPutResolver : PutResolver<Episode>() {
EpisodeTable.COL_SEEN to episode.seen, EpisodeTable.COL_SEEN to episode.seen,
EpisodeTable.COL_BOOKMARK to episode.bookmark, EpisodeTable.COL_BOOKMARK to episode.bookmark,
EpisodeTable.COL_LAST_SECOND_SEEN to episode.last_second_seen, EpisodeTable.COL_LAST_SECOND_SEEN to episode.last_second_seen,
EpisodeTable.COL_TOTAL_SECONDS to episode.total_seconds,
) )
} }