3
3
Fork 1
mirror of https://github.com/recloudstream/cloudstream.git synced 2024-08-15 01:53:11 +00:00

nullable secondsToReadable

This commit is contained in:
KingLucius 2024-07-23 10:27:49 +03:00
parent 8cff45ddd1
commit 7d56aad305
2 changed files with 5 additions and 2 deletions
app/src/main/java/com/lagradost/cloudstream3

View file

@ -73,7 +73,10 @@ abstract class AccountManager(private val defIndex: Int) : AuthAPI {
const val maxStale = 60 * 10
fun secondsToReadable(seconds: Int, completedValue: String): String {
fun secondsToReadable(seconds: Int?, completedValue: String?): String? {
seconds ?: return null
var secondsLong = seconds.toLong()
val days = TimeUnit.SECONDS
.toDays(secondsLong)

View file

@ -299,7 +299,7 @@ class EpisodeAdapter(
episodeRuntime.setText(
txt(
card.runTime?.times(60L)?.let { secondsToReadable(it.toInt(), "0 mins") }
secondsToReadable(card.runTime?.times(60L)?.toInt(), null)
)
)