Skip to content

Commit

Permalink
fix: some context issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelonion committed Apr 30, 2024
1 parent 040b084 commit 4fc96b7
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions app/src/main/java/ani/dantotsu/connections/anilist/api/Media.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,17 @@ enum class MediaStatus {
FINISHED, RELEASING, NOT_YET_RELEASED, CANCELLED, HIATUS;

override fun toString(): String {
return when (super.toString()) {
"FINISHED" -> currContext()!!.getString(R.string.status_finished)
"RELEASING" -> currContext()!!.getString(R.string.status_releasing)
"NOT_YET_RELEASED" -> currContext()!!.getString(R.string.status_not_yet_released)
"CANCELLED" -> currContext()!!.getString(R.string.status_cancelled)
"HIATUS" -> currContext()!!.getString(R.string.status_hiatus)
else -> ""
currContext()?.let {
return when (super.toString()) {
"FINISHED" -> it.getString(R.string.status_finished)
"RELEASING" -> it.getString(R.string.status_releasing)
"NOT_YET_RELEASED" -> it.getString(R.string.status_not_yet_released)
"CANCELLED" -> it.getString(R.string.status_cancelled)
"HIATUS" -> it.getString(R.string.status_hiatus)
else -> ""
}
}

return super.toString().replace("_", " ")
}
}

Expand Down Expand Up @@ -445,17 +447,20 @@ enum class MediaRelation {
ADAPTATION, PREQUEL, SEQUEL, PARENT, SIDE_STORY, CHARACTER, SUMMARY, ALTERNATIVE, SPIN_OFF, OTHER, SOURCE, COMPILATION, CONTAINS;

override fun toString(): String {
return when (super.toString()) {
"ADAPTATION" -> currContext()!!.getString(R.string.type_adaptation)
"PARENT" -> currContext()!!.getString(R.string.type_parent)
"CHARACTER" -> currContext()!!.getString(R.string.type_character)
"SUMMARY" -> currContext()!!.getString(R.string.type_summary)
"ALTERNATIVE" -> currContext()!!.getString(R.string.type_alternative)
"OTHER" -> currContext()!!.getString(R.string.type_other)
"SOURCE" -> currContext()!!.getString(R.string.type_source)
"CONTAINS" -> currContext()!!.getString(R.string.type_contains)
else -> super.toString().replace("_", " ")
currContext()?.let {
return when (super.toString()) {
"ADAPTATION" -> it.getString(R.string.type_adaptation)
"PARENT" -> it.getString(R.string.type_parent)
"CHARACTER" -> it.getString(R.string.type_character)
"SUMMARY" -> it.getString(R.string.type_summary)
"ALTERNATIVE" -> it.getString(R.string.type_alternative)
"OTHER" -> it.getString(R.string.type_other)
"SOURCE" -> it.getString(R.string.type_source)
"CONTAINS" -> it.getString(R.string.type_contains)
else -> super.toString().replace("_", " ")
}
}
return super.toString().replace("_", " ")
}
}

Expand Down

0 comments on commit 4fc96b7

Please sign in to comment.