From 7fd4c69c3ebdf49038af7c8a540c59442e84a257 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Wed, 14 Apr 2021 20:53:06 -0400 Subject: [PATCH] Rename mangaType to seriesType --- .../java/eu/kanade/tachiyomi/data/database/models/Manga.kt | 6 +++--- .../ui/category/addtolibrary/SetCategoriesSheet.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt | 4 ++-- .../kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt | 6 +++--- .../eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt | 4 ++-- .../java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt | 2 +- .../eu/kanade/tachiyomi/ui/recents/RemoveHistoryDialog.kt | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt index 0652b4fbd4..b87d3b40da 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt @@ -53,9 +53,9 @@ interface Manga : SManga { fun showChapterTitle(defaultShow: Boolean): Boolean = chapter_flags and DISPLAY_MASK == DISPLAY_NUMBER - fun mangaType(context: Context): String { + fun seriesType(context: Context): String { return context.getString( - when (mangaType()) { + when (seriesType()) { TYPE_WEBTOON -> R.string.webtoon TYPE_MANHWA -> R.string.manhwa TYPE_MANHUA -> R.string.manhua @@ -76,7 +76,7 @@ interface Manga : SManga { /** * The type of comic the manga is (ie. manga, manhwa, manhua) */ - fun mangaType(): Int { + fun seriesType(): Int { val sourceName = Injekt.get().getOrStub(source).name val currentTags = genre?.split(",")?.map { it.trim().toLowerCase(Locale.US) } ?: emptyList() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt index 510058e1de..f1eaccf524 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt @@ -68,7 +68,7 @@ class SetCategoriesSheet( R.string.move_x_to }, if (listManga.size == 1) { - listManga.first().mangaType(context) + listManga.first().seriesType(context) } else { context.getString(R.string.selection).lowercase(Locale.ROOT) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 04e39ac3f2..4d712ac348 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -253,9 +253,9 @@ class LibraryPresenter( if (filterMangaType > 0) { if (if (filterMangaType == Manga.TYPE_MANHWA) { - (filterMangaType != item.manga.mangaType() && filterMangaType != Manga.TYPE_WEBTOON) + (filterMangaType != item.manga.seriesType() && filterMangaType != Manga.TYPE_WEBTOON) } else { - filterMangaType != item.manga.mangaType() + filterMangaType != item.manga.seriesType() } ) return false } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt index d139ee490f..b0ee40b262 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt @@ -280,9 +280,9 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri } val libraryManga = db.getLibraryMangas().executeAsBlocking() val types = mutableListOf() - if (libraryManga.any { it.mangaType() == Manga.TYPE_MANHWA }) types.add(R.string.manhwa) - if (libraryManga.any { it.mangaType() == Manga.TYPE_MANHUA }) types.add(R.string.manhua) - if (libraryManga.any { it.mangaType() == Manga.TYPE_COMIC }) types.add(R.string.comic) + if (libraryManga.any { it.seriesType() == Manga.TYPE_MANHWA }) types.add(R.string.manhwa) + if (libraryManga.any { it.seriesType() == Manga.TYPE_MANHUA }) types.add(R.string.manhua) + if (libraryManga.any { it.seriesType() == Manga.TYPE_COMIC }) types.add(R.string.comic) if (types.isNotEmpty()) { launchUI { val mangaType = inflate(R.layout.filter_tag_group) as FilterTagGroup diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index 0db752c605..852b371276 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -742,7 +742,7 @@ class MangaDetailsController : manga?.source != LocalSource.ID && presenter.manga.favorite menu.findItem(R.id.action_migrate).title = view?.context?.getString( R.string.migrate_, - presenter.manga.mangaType(view!!.context) + presenter.manga.seriesType(view!!.context) ) val iconPrimary = view?.context?.getResourceColor(android.R.attr.textColorPrimary) ?: Color.BLACK @@ -980,7 +980,7 @@ class MangaDetailsController : presenter.downloadChapters(chapters) val text = view.context.getString( R.string.add_x_to_library, - presenter.manga.mangaType + presenter.manga.seriesType (view.context).toLowerCase(Locale.ROOT) ) if (!presenter.manga.favorite && ( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt index deed1fd37c..02a8ad27ec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt @@ -171,7 +171,7 @@ class MangaHeaderHolder( } binding.mangaSummaryLabel.text = itemView.context.getString( R.string.about_this_, - manga.mangaType(itemView.context) + manga.seriesType(itemView.context) ) with(binding.favoriteButton) { icon = ContextCompat.getDrawable( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RemoveHistoryDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RemoveHistoryDialog.kt index 266c80f399..00175b4d37 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RemoveHistoryDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RemoveHistoryDialog.kt @@ -40,7 +40,7 @@ class RemoveHistoryDialog(bundle: Bundle? = null) : DialogController(bundle) ).checkBoxPrompt( text = activity.getString( R.string.reset_all_chapters_for_this_, - manga!!.mangaType(activity) + manga!!.seriesType(activity) ) ) {}.negativeButton(android.R.string.cancel).positiveButton(R.string.reset) { onPositive(it.isCheckPromptChecked())