mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
nullable secondsToReadable
This commit is contained in:
parent
8cff45ddd1
commit
7d56aad305
2 changed files with 5 additions and 2 deletions
|
@ -73,7 +73,10 @@ abstract class AccountManager(private val defIndex: Int) : AuthAPI {
|
||||||
|
|
||||||
const val maxStale = 60 * 10
|
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()
|
var secondsLong = seconds.toLong()
|
||||||
val days = TimeUnit.SECONDS
|
val days = TimeUnit.SECONDS
|
||||||
.toDays(secondsLong)
|
.toDays(secondsLong)
|
||||||
|
|
|
@ -299,7 +299,7 @@ class EpisodeAdapter(
|
||||||
|
|
||||||
episodeRuntime.setText(
|
episodeRuntime.setText(
|
||||||
txt(
|
txt(
|
||||||
card.runTime?.times(60L)?.let { secondsToReadable(it.toInt(), "0 mins") }
|
secondsToReadable(card.runTime?.times(60L)?.toInt(), null)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue