fix: splitted status list and cleaned up

This commit is contained in:
sneazy-ibo
2024-03-22 13:14:27 +01:00
parent 6736b7068d
commit ed02193ec7
3 changed files with 13 additions and 6 deletions

View File

@@ -45,7 +45,14 @@ object Anilist {
"SCORE"
)
val status = listOf(
val animeStatus = listOf(
"FINISHED",
"RELEASING",
"NOT_YET_RELEASED",
"CANCELLED"
)
val mangaStatus = listOf(
"FINISHED",
"RELEASING",
"NOT_YET_RELEASED",
@@ -57,11 +64,11 @@ object Anilist {
"WINTER", "SPRING", "SUMMER", "FALL"
)
val anime_formats = listOf(
val animeFormats = listOf(
"TV", "TV SHORT", "MOVIE", "SPECIAL", "OVA", "ONA", "MUSIC"
)
val manga_formats = listOf(
val mangaFormats = listOf(
"MANGA", "NOVEL", "ONE SHOT"
)

View File

@@ -184,7 +184,7 @@ class SearchActivity : AppCompatActivity() {
override fun run() {
scope.launch(Dispatchers.IO) {
loading = true
model.loadSearch(result.copy(status = result.status))
model.loadSearch(result)
loading = false
}
}

View File

@@ -244,7 +244,7 @@ class SearchFilterBottomDialog : BottomSheetDialogFragment() {
ArrayAdapter(
binding.root.context,
R.layout.item_dropdown,
Anilist.status.toTypedArray()
(if (activity.result.type == "ANIME") Anilist.animeStatus else Anilist.mangaStatus).toTypedArray()
)
)
@@ -253,7 +253,7 @@ class SearchFilterBottomDialog : BottomSheetDialogFragment() {
ArrayAdapter(
binding.root.context,
R.layout.item_dropdown,
(if (activity.result.type == "ANIME") Anilist.anime_formats else Anilist.manga_formats).toTypedArray()
(if (activity.result.type == "ANIME") Anilist.animeFormats else Anilist.mangaFormats).toTypedArray()
)
)