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

@@ -0,0 +1,3 @@
package tachiyomi.domain.chapter.model
class NoChaptersException : Exception()

View File

@@ -0,0 +1,17 @@
package tachiyomi.domain.track.model
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,
)

View File

@@ -0,0 +1,21 @@
package tachiyomi.domain.track.repository
import kotlinx.coroutines.flow.Flow
import tachiyomi.domain.track.model.Track
interface TrackRepository {
suspend fun getTrackById(id: Long): Track?
suspend fun getTracksByMangaId(mangaId: Long): List<Track>
fun getTracksAsFlow(): Flow<List<Track>>
fun getTracksByMangaIdAsFlow(mangaId: Long): Flow<List<Track>>
suspend fun delete(mangaId: Long, syncId: Long)
suspend fun insert(track: Track)
suspend fun insertAll(tracks: List<Track>)
}