Merge pull request #4735 from Bnyro/master

fix: video upload date not saved to watch history
This commit is contained in:
Bnyro 2023-09-10 12:27:08 +02:00 committed by GitHub
commit 2ef4dd7df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package com.github.libretube.api.obj
import com.github.libretube.db.obj.DownloadItem
import com.github.libretube.enums.FileType
import com.github.libretube.extensions.toMillis
import com.github.libretube.helpers.ProxyHelper
import com.github.libretube.parcelable.DownloadData
import kotlin.io.path.Path
@ -84,7 +85,7 @@ data class Streams(
uploaderUrl = uploaderUrl,
uploaderAvatar = uploaderAvatar,
uploadedDate = uploadDate.toString(),
uploaded = null,
uploaded = uploadDate.toMillis(),
duration = duration,
views = views,
uploaderVerified = uploaderVerified,

View File

@ -29,9 +29,10 @@ object DatabaseHelper {
videoId,
stream.title,
stream.uploaded?.let {
Instant.ofEpochMilli(
it
).atZone(ZoneId.systemDefault()).toLocalDate().toKotlinLocalDate()
Instant.ofEpochMilli(it)
.atZone(ZoneId.systemDefault())
.toLocalDate()
.toKotlinLocalDate()
},
stream.uploaderName,
stream.uploaderUrl?.toID(),

View File

@ -27,6 +27,7 @@ import com.github.libretube.api.obj.Streams
import com.github.libretube.constants.IntentData
import com.github.libretube.constants.PLAYER_CHANNEL_ID
import com.github.libretube.constants.PLAYER_NOTIFICATION_ID
import com.github.libretube.db.DatabaseHelper
import com.github.libretube.db.DatabaseHolder.Database
import com.github.libretube.db.obj.WatchPosition
import com.github.libretube.extensions.parcelableExtra