Minor tracking cleanups

This commit is contained in:
arkon
2023-12-24 22:25:22 -05:00
parent 6d74a86711
commit 6887d98f15
24 changed files with 64 additions and 69 deletions

View File

@@ -7,7 +7,6 @@ import tachiyomi.domain.track.model.Track
@Serializable
data class BackupTracking(
// in 1.x some of these values have different types or names
// syncId is called siteId in 1,x
@ProtoNumber(1) var syncId: Int,
// LibraryId is not null in 1.x
@ProtoNumber(2) var libraryId: Long,
@@ -34,7 +33,7 @@ data class BackupTracking(
return Track(
id = -1,
mangaId = -1,
syncId = this@BackupTracking.syncId.toLong(),
trackerId = this@BackupTracking.syncId.toLong(),
remoteId = if (this@BackupTracking.mediaIdInt != 0) {
this@BackupTracking.mediaIdInt.toLong()
} else {

View File

@@ -8,9 +8,9 @@ class DeleteTrack(
private val trackRepository: TrackRepository,
) {
suspend fun await(mangaId: Long, syncId: Long) {
suspend fun await(mangaId: Long, trackerId: Long) {
try {
trackRepository.delete(mangaId, syncId)
trackRepository.delete(mangaId, trackerId)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
}

View File

@@ -3,7 +3,7 @@ package tachiyomi.domain.track.model
data class Track(
val id: Long,
val mangaId: Long,
val syncId: Long,
val trackerId: Long,
val remoteId: Long,
val libraryId: Long?,
val title: String,

View File

@@ -13,7 +13,7 @@ interface TrackRepository {
fun getTracksByMangaIdAsFlow(mangaId: Long): Flow<List<Track>>
suspend fun delete(mangaId: Long, syncId: Long)
suspend fun delete(mangaId: Long, trackerId: Long)
suspend fun insert(track: Track)