mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Fix Kitsu ratingTwenty being typed as String (#1191)
				
					
				
			The API docs and the responses type `ratingTwenty` as a "number" (Int in Kotlin, it's divided by 2 for a .5 step scale 0-10). It's nullable because an entry without a user rating returns `null` in that field.
This commit is contained in:
		| @@ -40,7 +40,7 @@ data class KitsuListSearchResult( | ||||
|                 "planned" -> Kitsu.PLAN_TO_READ | ||||
|                 else -> throw Exception("Unknown status") | ||||
|             } | ||||
|             score = userDataAttrs.ratingTwenty?.let { it.toInt() / 2.0 } ?: 0.0 | ||||
|             score = userDataAttrs.ratingTwenty?.let { it / 2.0 } ?: 0.0 | ||||
|             last_chapter_read = userDataAttrs.progress.toDouble() | ||||
|         } | ||||
|     } | ||||
| @@ -57,7 +57,7 @@ data class KitsuListSearchItemDataAttributes( | ||||
|     val status: String, | ||||
|     val startedAt: String?, | ||||
|     val finishedAt: String?, | ||||
|     val ratingTwenty: String?, | ||||
|     val ratingTwenty: Int?, | ||||
|     val progress: Int, | ||||
| ) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user