forked from recloudstream/cloudstream
Add default cover when posterUrl is null or empty (#423)
* add default cover image for when posterUrl is null or empty. * show monke image on load when posterUrl is null or empty. Also, shows 'No Episodes found'on Tv Series when ep count is 0 * replace default cover image
This commit is contained in:
parent
f7aa1ce06d
commit
296f58a0b2
4 changed files with 43 additions and 5 deletions
|
@ -1095,6 +1095,15 @@ class ResultFragment : Fragment() {
|
|||
}
|
||||
result_info?.isVisible = api.providerType == ProviderType.MetaProvider
|
||||
|
||||
if (d.type.isEpisodeBased()) {
|
||||
val ep = d as? TvSeriesLoadResponse
|
||||
val epCount = ep?.episodes?.size ?: 1
|
||||
if (epCount < 1) {
|
||||
result_info?.text = getString(R.string.no_episodes_found)
|
||||
result_info?.isVisible = true
|
||||
}
|
||||
}
|
||||
|
||||
currentHeaderName = d.name
|
||||
currentType = d.type
|
||||
|
||||
|
@ -1158,11 +1167,15 @@ class ResultFragment : Fragment() {
|
|||
|
||||
result_meta_site?.text = d.apiName
|
||||
|
||||
result_poster?.setImage(d.posterUrl)
|
||||
result_poster_blur?.setImageBlur(d.posterUrl, 10, 3)
|
||||
if (!d.posterUrl.isNullOrEmpty()) {
|
||||
result_poster?.setImage(d.posterUrl)
|
||||
result_poster_blur?.setImageBlur(d.posterUrl, 10, 3)
|
||||
} else {
|
||||
result_poster?.setImageResource(R.drawable.default_cover)
|
||||
result_poster_blur?.setImageResource(R.drawable.default_cover)
|
||||
}
|
||||
|
||||
result_poster_holder?.visibility =
|
||||
if (d.posterUrl.isNullOrBlank()) GONE else VISIBLE
|
||||
result_poster_holder?.visibility = VISIBLE
|
||||
|
||||
result_play_movie?.text =
|
||||
if (d.type == TvType.Torrent) getString(R.string.play_torrent_button) else getString(
|
||||
|
|
|
@ -48,7 +48,11 @@ object SearchResultBuilder {
|
|||
cardText?.text = card.name
|
||||
|
||||
//imageTextProvider.text = card.apiName
|
||||
cardView.setImage(card.posterUrl)
|
||||
if (!card.posterUrl.isNullOrEmpty()) {
|
||||
cardView.setImage(card.posterUrl)
|
||||
} else {
|
||||
cardView.setImageResource(R.drawable.default_cover)
|
||||
}
|
||||
|
||||
bg.setOnClickListener {
|
||||
clickCallback.invoke(
|
||||
|
|
20
app/src/main/res/drawable/default_cover.xml
Normal file
20
app/src/main/res/drawable/default_cover.xml
Normal file
File diff suppressed because one or more lines are too long
|
@ -223,6 +223,7 @@
|
|||
<string name="episodes">Episodes</string>
|
||||
<string name="season_short">S</string>
|
||||
<string name="episode_short">E</string>
|
||||
<string name="no_episodes_found">No Episodes found</string>
|
||||
|
||||
<string name="delete_file">Delete File</string>
|
||||
<string name="delete">Delete</string>
|
||||
|
|
Loading…
Reference in a new issue