Rename mangaType to seriesType

This commit is contained in:
Jays2Kings 2021-04-14 20:53:06 -04:00
parent 3cd5043e67
commit 7fd4c69c3e
7 changed files with 13 additions and 13 deletions

View File

@ -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<SourceManager>().getOrStub(source).name
val currentTags =
genre?.split(",")?.map { it.trim().toLowerCase(Locale.US) } ?: emptyList()

View File

@ -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)
}

View File

@ -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
}

View File

@ -280,9 +280,9 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri
}
val libraryManga = db.getLibraryMangas().executeAsBlocking()
val types = mutableListOf<Int>()
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

View File

@ -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 && (

View File

@ -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(

View File

@ -40,7 +40,7 @@ class RemoveHistoryDialog<T>(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())