Hide duration if unknown

This commit is contained in:
Kelvin K 2025-06-18 14:27:20 +02:00
commit 11992af81b
2 changed files with 15 additions and 3 deletions

View file

@ -95,7 +95,13 @@ class VideoListEditorViewHolder : ViewHolder {
.into(_imageThumbnail);
_textName.text = v.name;
_textAuthor.text = v.author.name;
_textVideoDuration.text = v.duration.toHumanTime(false);
if(v.duration > 0) {
_textVideoDuration.text = v.duration.toHumanTime(false);
_textVideoDuration.visibility = View.VISIBLE;
}
else
_textVideoDuration.visibility = View.GONE;
val historyPosition = StateHistory.instance.getHistoryPosition(v.url)
_timeBar.progress = historyPosition.toFloat() / v.duration.toFloat();

View file

@ -204,8 +204,14 @@ open class PreviewVideoView : LinearLayout {
.into(_imageVideo);
};
if(!isPlanned)
_textVideoDuration.text = video.duration.toHumanTime(false);
if(!isPlanned) {
if(video.duration > 0) {
_textVideoDuration.text = video.duration.toHumanTime(false);
_textVideoDuration.visibility = View.VISIBLE;
}
else
_textVideoDuration.visibility = View.GONE;
}
else
_textVideoDuration.text = context.getString(R.string.planned);