mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-18 00:59:42 +02:00
Add user manga notes (#428)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package tachiyomi.domain.manga.interactor
|
||||
|
||||
import tachiyomi.domain.manga.model.MangaUpdate
|
||||
import tachiyomi.domain.manga.repository.MangaRepository
|
||||
|
||||
class UpdateMangaNotes(
|
||||
private val mangaRepository: MangaRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(mangaId: Long, notes: String): Boolean {
|
||||
return mangaRepository.update(
|
||||
MangaUpdate(
|
||||
id = mangaId,
|
||||
notes = notes,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
@@ -32,6 +32,7 @@ data class Manga(
|
||||
val lastModifiedAt: Long,
|
||||
val favoriteModifiedAt: Long?,
|
||||
val version: Long,
|
||||
val notes: String,
|
||||
) : Serializable {
|
||||
|
||||
val expectedNextUpdate: Instant?
|
||||
@@ -126,6 +127,7 @@ data class Manga(
|
||||
lastModifiedAt = 0L,
|
||||
favoriteModifiedAt = null,
|
||||
version = 0L,
|
||||
notes = "",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ data class MangaUpdate(
|
||||
val updateStrategy: UpdateStrategy? = null,
|
||||
val initialized: Boolean? = null,
|
||||
val version: Long? = null,
|
||||
val notes: String? = null,
|
||||
)
|
||||
|
||||
fun Manga.toMangaUpdate(): MangaUpdate {
|
||||
@@ -49,5 +50,6 @@ fun Manga.toMangaUpdate(): MangaUpdate {
|
||||
updateStrategy = updateStrategy,
|
||||
initialized = initialized,
|
||||
version = version,
|
||||
notes = notes,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user