From 62916708f5bdea4937fbee96f2b2f482d7f12133 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 28 Apr 2024 21:52:24 +0300 Subject: [PATCH] fix channel update with null data --- app/src/main/java/ru/yourok/torrserve/atv/Utils.kt | 5 ++--- .../ru/yourok/torrserve/server/models/torrent/Torrent.kt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/yourok/torrserve/atv/Utils.kt b/app/src/main/java/ru/yourok/torrserve/atv/Utils.kt index fd5e71f0..8b0fc499 100644 --- a/app/src/main/java/ru/yourok/torrserve/atv/Utils.kt +++ b/app/src/main/java/ru/yourok/torrserve/atv/Utils.kt @@ -87,16 +87,15 @@ object Utils { vintent.putExtra("action", "play") vintent.putExtra("hash", torr.hash) vintent.putExtra("title", torr.title) - vintent.putExtra("poster", torr.poster) + if (torr.poster.isNotBlank()) vintent.putExtra("poster", torr.poster) torr.category?.let { if (it.isNotBlank()) vintent.putExtra("category", it) } - if (torr.data.isNotBlank()) vintent.putExtra("data", torr.data) + torr.data?.let {if (it.isNotBlank()) vintent.putExtra("data", it) } vintent.putExtra("save", false) return vintent } private var lock = Any() fun updateAtvCards() { - if (isGoogleTV) { synchronized(lock) { if (lock == true) diff --git a/app/src/main/java/ru/yourok/torrserve/server/models/torrent/Torrent.kt b/app/src/main/java/ru/yourok/torrserve/server/models/torrent/Torrent.kt index c3f73978..6fba7ea2 100644 --- a/app/src/main/java/ru/yourok/torrserve/server/models/torrent/Torrent.kt +++ b/app/src/main/java/ru/yourok/torrserve/server/models/torrent/Torrent.kt @@ -4,7 +4,7 @@ data class Torrent( var title: String, var poster: String, var category: String?, - var data: String, + var data: String?, var timestamp: Long, var name: String, var hash: String,