Move more to data and domain modules (#8973)
(cherry picked from commit cdf242e8c8e4b8142d9f4167b0187a32ea1a4d35) # Conflicts: # app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt # app/src/main/java/eu/kanade/domain/track/interactor/GetTracksPerManga.kt # app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt # app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
package tachiyomi.domain.chapter.model
|
||||
|
||||
class NoChaptersException : Exception()
|
||||
@@ -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,
|
||||
)
|
||||
@@ -0,0 +1,27 @@
|
||||
package tachiyomi.domain.track.repository
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import tachiyomi.domain.track.model.Track
|
||||
|
||||
interface TrackRepository {
|
||||
|
||||
suspend fun getTrackById(id: Long): Track?
|
||||
|
||||
// SY -->
|
||||
suspend fun getTracks(): List<Track>
|
||||
|
||||
suspend fun getTracksByMangaIds(mangaIds: List<Long>): List<Track>
|
||||
// SY <--
|
||||
|
||||
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>)
|
||||
}
|
||||
Reference in New Issue
Block a user