Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/src/main/java/com/github/libretube/api/obj/Streams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ data class Streams(

@Serializable(SafeInstantSerializer::class)
@SerialName("uploadDate")
val uploadTimestamp: Instant,
val uploadTimestamp: Instant?,
val uploaded: Long? = null,

val uploader: String,
val uploaderUrl: String,
Expand Down Expand Up @@ -91,9 +92,9 @@ data class Streams(
uploaderName = uploader,
uploaderUrl = uploaderUrl,
uploaderAvatar = uploaderAvatar,
uploadedDate = uploadTimestamp.toLocalDateTime(TimeZone.currentSystemDefault()).date
.toString(),
uploaded = uploadTimestamp.toEpochMilliseconds(),
uploadedDate = uploadTimestamp?.toLocalDateTime(TimeZone.currentSystemDefault())?.date
?.toString(),
uploaded = uploaded ?: uploadTimestamp?.toEpochMilliseconds() ?: 0,
duration = duration,
views = views,
uploaderVerified = uploaderVerified,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class DownloadService : LifecycleService() {
streams.description,
streams.uploader,
streams.duration,
streams.uploadTimestamp.toLocalDateTime(TimeZone.currentSystemDefault()).date,
streams.uploadTimestamp?.toLocalDateTime(TimeZone.currentSystemDefault())?.date,
thumbnailTargetPath
)
Database.downloadDao().insertDownload(download)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
commentsViewModel.setCommentSheetExpand(null)

updateResolutionOnFullscreenChange(true)

openOrCloseFullscreenDialog(true)

binding.player.updateMarginsByFullscreenMode()
Expand All @@ -691,7 +690,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
fun unsetFullscreen() {
viewModel.isFullscreen.value = false

if (!PlayerHelper.autoFullscreenEnabled) {
if (!PlayerHelper.autoFullscreenEnabled && activity != null) {
mainActivity.requestedOrientation = mainActivity.screenOrientationPref
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ class DescriptionLayout(
}

private fun localizeDate(streams: Streams): String {
if (streams.livestream) return ""
if (streams.livestream || streams.uploadTimestamp == null) return ""

val date = streams.uploadTimestamp.toLocalDateTime(TimeZone.currentSystemDefault()).date

return TextUtils.SEPARATOR + TextUtils.localizeDate(date)
}

Expand Down