Move more to data and domain modules (#8973)

This commit is contained in:
Andreas
2023-01-22 22:19:22 +01:00
committed by GitHub
parent aee785a8bb
commit cdf242e8c8
27 changed files with 65 additions and 64 deletions

View File

@@ -1,31 +1,16 @@
package eu.kanade.domain.track.model
import tachiyomi.domain.track.model.Track
import eu.kanade.tachiyomi.data.database.models.Track as DbTrack
data class Track(
val id: Long,
val mangaId: Long,
val syncId: Long,
val remoteId: Long,
val libraryId: Long?,
val title: String,
val lastChapterRead: Double,
val totalChapters: Long,
val status: Long,
val score: Float,
val remoteUrl: String,
val startDate: Long,
val finishDate: Long,
) {
fun copyPersonalFrom(other: Track): Track {
return this.copy(
lastChapterRead = other.lastChapterRead,
score = other.score,
status = other.status,
startDate = other.startDate,
finishDate = other.finishDate,
)
}
fun Track.copyPersonalFrom(other: Track): Track {
return this.copy(
lastChapterRead = other.lastChapterRead,
score = other.score,
status = other.status,
startDate = other.startDate,
finishDate = other.finishDate,
)
}
fun Track.toDbTrack(): DbTrack = DbTrack.create(syncId).also {