Remove episode number from episode title like saikou (#119)
* Add files via upload * Add files via upload * Add files via upload * use existing robust episode regex * use existing robust episode regex * use existing robust episode regex * use existing robust episode regex * allow external use of manga chapter regex as well --------- Co-authored-by: rebel onion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
parent
038b8f7ff7
commit
97cd3dd43b
5 changed files with 84 additions and 75 deletions
|
@ -11,6 +11,7 @@ import ani.dantotsu.connections.updateProgress
|
|||
import ani.dantotsu.databinding.ItemEpisodeCompactBinding
|
||||
import ani.dantotsu.databinding.ItemEpisodeGridBinding
|
||||
import ani.dantotsu.databinding.ItemEpisodeListBinding
|
||||
import ani.dantotsu.media.anime.AnimeNameAdapter
|
||||
import ani.dantotsu.media.Media
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
|
@ -76,12 +77,11 @@ class EpisodeAdapter(
|
|||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val ep = arr[position]
|
||||
val title =
|
||||
"${
|
||||
if (!ep.title.isNullOrEmpty() && ep.title != "null") "" else currContext()!!.getString(
|
||||
R.string.episode_singular
|
||||
)
|
||||
} ${if (!ep.title.isNullOrEmpty() && ep.title != "null") ep.title else ep.number}"
|
||||
val title = if (!ep.title.isNullOrEmpty() && ep.title != "null") {
|
||||
(ep.title as? String)?.replaceFirst(Regex(AnimeNameAdapter.episodeRegex, RegexOption.IGNORE_CASE), "")
|
||||
} else {
|
||||
ep.number
|
||||
} ?: ""
|
||||
|
||||
when (holder) {
|
||||
is EpisodeListViewHolder -> {
|
||||
|
@ -246,4 +246,3 @@ class EpisodeAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue