Skip to content

Commit a226592

Browse files
committed
Fix: correct score format display
1 parent 44b0b6e commit a226592

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [v2.1.1]
11+
### Fixed
12+
- Fix score always showing in 10 points.
13+
1014
## [v2.1.0]
1115
### Added
1216
- Add badge icon to season screen as well.

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ android {
1919

2020
defaultConfig {
2121
applicationId = "com.revolgenx.anilib"
22-
versionCode = 53
23-
versionName = "2.1.0"
22+
versionCode = 54
23+
versionName = "2.1.1"
2424

2525
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2626
vectorDrawables {

app/src/main/graphql/com/revolgenx/anilib/list.graphql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ query MediaListCollectionQuery(
1111
isCustomList
1212
isCompletedList: isSplitCompletedList
1313
entries {
14-
... mediaListEntry
14+
score100: score(format: POINT_100)
1515
score10: score(format: POINT_10)
16+
score10d: score(format: POINT_10_DECIMAL)
17+
score5: score(format: POINT_5)
18+
score3: score(format: POINT_3)
19+
... mediaListEntry
1620
media {
1721
... media
1822
idMal
@@ -256,7 +260,7 @@ fragment mediaListEntry on MediaList {
256260
id
257261
mediaId
258262
status
259-
score
263+
score(format: null)
260264
progress
261265
progressVolumes
262266
repeat

app/src/main/kotlin/com/revolgenx/anilib/list/ui/model/MediaListCollectionModel.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.revolgenx.anilib.MediaListCollectionQuery
55
import com.revolgenx.anilib.common.ext.orZero
66
import com.revolgenx.anilib.list.data.field.MediaListCollectionField
77
import com.revolgenx.anilib.media.ui.model.toModel
8+
import com.revolgenx.anilib.type.ScoreFormat
89
import com.revolgenx.anilib.user.ui.model.MediaListOptionModel
910
import com.revolgenx.anilib.user.ui.model.UserModel
1011
import com.revolgenx.anilib.user.ui.model.getRowOrder
@@ -32,6 +33,8 @@ fun MediaListCollectionQuery.Data.toModel(field: MediaListCollectionField): Medi
3233
)
3334
}
3435

36+
val scoreFormat = userModel?.mediaListOptions?.scoreFormat
37+
3538
val sectionOrder =
3639
userModel?.mediaListOptions?.let { it.animeList ?: it.mangaList }?.sectionOrder
3740

@@ -55,6 +58,14 @@ fun MediaListCollectionQuery.Data.toModel(field: MediaListCollectionField): Medi
5558
?.let { entryModel ->
5659
entryModel.copy(
5760
idMal = entry.media?.idMal,
61+
score = when(scoreFormat){
62+
ScoreFormat.POINT_100 -> entry.score100
63+
ScoreFormat.POINT_10_DECIMAL -> entry.score10d
64+
ScoreFormat.POINT_10 -> entry.score10
65+
ScoreFormat.POINT_5 -> entry.score5
66+
ScoreFormat.POINT_3 -> entry.score3
67+
else -> null
68+
},
5869
score10 = entry.score10?.toInt().orZero(),
5970
userId = userModel?.id ?: -1,
6071
user = userModel,

app/src/main/res/values/string-releases.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
- **If the UI is too big**, you can reduce it from **Settings → Appearance → Display Scale**. \n
77
- **If there are too many ads**, you can change the frequency from **Settings → Support → Ads**. \n
88

9+
## v2.1.1 \n
10+
### Fixed \n
11+
- Fixed score always showing in 10 points. \n
12+
913
## v2.1.0 \n
1014
### Added \n
1115
- Add badge in season screen filter icon. \n

0 commit comments

Comments
 (0)