Update types of legacy tracker model to match to domain one (#245)

* `score` to Double

* `tracker_id` to Long

* `last_chapter_read` to Double

* `total_chapters` to Long

* `status` to Long
This commit is contained in:
AntsyLich
2024-01-27 23:17:09 +06:00
committed by GitHub
parent 65bfa083f2
commit 05efc4ebeb
36 changed files with 249 additions and 244 deletions

View File

@@ -285,13 +285,13 @@ private data class TrackStatusSelectorScreen(
private class Model(
private val track: Track,
private val tracker: Tracker,
) : StateScreenModel<Model.State>(State(track.status.toInt())) {
) : StateScreenModel<Model.State>(State(track.status)) {
fun getSelections(): Map<Int, StringResource?> {
fun getSelections(): Map<Long, StringResource?> {
return tracker.getStatusList().associateWith { tracker.getStatus(it) }
}
fun setSelection(selection: Int) {
fun setSelection(selection: Long) {
mutableState.update { it.copy(selection = selection) }
}
@@ -303,7 +303,7 @@ private data class TrackStatusSelectorScreen(
@Immutable
data class State(
val selection: Int,
val selection: Long,
)
}
}