mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-11 14:54:33 -05:00
Update Tracking Backend (#1457)
* Update Tracking Library * Update Bangumi * Update Anilist * Update MangaUpdates * Update MAL * Add private to bind track * Use null * Remove old nullable * Remove custom implementation of supportsTrackDeletion * Add private to updateTrack * Some descriptions * Another description
This commit is contained in:
@@ -473,14 +473,14 @@ object ProtoBackupImport : ProtoBackupBase() {
|
||||
Tracker
|
||||
.getTrackRecordsByMangaId(mangaId)
|
||||
.mapNotNull { it.record?.toTrack() }
|
||||
.associateBy { it.sync_id }
|
||||
.associateBy { it.tracker_id }
|
||||
|
||||
val (existingTracks, newTracks) =
|
||||
tracks
|
||||
.mapNotNull { backupTrack ->
|
||||
val track = backupTrack.toTrack(mangaId)
|
||||
|
||||
val isUnsupportedTracker = TrackerManager.getTracker(track.sync_id) == null
|
||||
val isUnsupportedTracker = TrackerManager.getTracker(track.tracker_id) == null
|
||||
if (isUnsupportedTracker) {
|
||||
return@mapNotNull null
|
||||
}
|
||||
@@ -495,7 +495,7 @@ object ProtoBackupImport : ProtoBackupBase() {
|
||||
}
|
||||
|
||||
dbTrack.also {
|
||||
it.media_id = track.media_id
|
||||
it.remote_id = track.remote_id
|
||||
it.library_id = track.library_id
|
||||
it.last_chapter_read = max(dbTrack.last_chapter_read, track.last_chapter_read)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ data class BackupTracking(
|
||||
@ProtoNumber(10) var startedReadingDate: Long = 0,
|
||||
// finishedReadingDate is called endReadTime in 1.x
|
||||
@ProtoNumber(11) var finishedReadingDate: Long = 0,
|
||||
@ProtoNumber(12) var private: Boolean = false,
|
||||
@ProtoNumber(100) var mediaId: Long = 0,
|
||||
) {
|
||||
fun getTrackingImpl(): TrackImpl =
|
||||
|
||||
Reference in New Issue
Block a user