diff --git a/app/src/main/java/ru/yourok/torrserve/ui/fragments/play/InfoFragment.kt b/app/src/main/java/ru/yourok/torrserve/ui/fragments/play/InfoFragment.kt index 165f72f7..749c1fc3 100644 --- a/app/src/main/java/ru/yourok/torrserve/ui/fragments/play/InfoFragment.kt +++ b/app/src/main/java/ru/yourok/torrserve/ui/fragments/play/InfoFragment.kt @@ -58,7 +58,7 @@ open class InfoFragment : TSFragment() { return vi } - private var poster = " " + private var posterUrl = " " suspend fun startInfo(hash: String) = withContext(Dispatchers.Main) { try { viewModel = ViewModelProvider(this@InfoFragment)[InfoViewModel::class.java] @@ -83,14 +83,14 @@ open class InfoFragment : TSFragment() { } info.torrent?.let { torr -> view?.apply { - if (!torr.poster.isNullOrEmpty() && poster != torr.poster) { - poster = torr.poster!! - if (poster.isNotBlank() && Settings.showCover()) + if (posterUrl != torr.poster) { + posterUrl = torr.poster ?: "" + if (posterUrl.isNotEmpty() && Settings.showCover()) findViewById(R.id.ivPoster)?.let { it.visibility = View.VISIBLE Glide.with(this) .asBitmap() - .load(poster) + .load(posterUrl) .centerCrop() //.placeholder(ColorDrawable(0x3c000000)) .apply(RequestOptions.bitmapTransform(RoundedCorners(6)))