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

View File

@ -29,9 +29,10 @@ object DatabaseHelper {
videoId, videoId,
stream.title, stream.title,
stream.uploaded?.let { stream.uploaded?.let {
Instant.ofEpochMilli( Instant.ofEpochMilli(it)
it .atZone(ZoneId.systemDefault())
).atZone(ZoneId.systemDefault()).toLocalDate().toKotlinLocalDate() .toLocalDate()
.toKotlinLocalDate()
}, },
stream.uploaderName, stream.uploaderName,
stream.uploaderUrl?.toID(), 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.IntentData
import com.github.libretube.constants.PLAYER_CHANNEL_ID import com.github.libretube.constants.PLAYER_CHANNEL_ID
import com.github.libretube.constants.PLAYER_NOTIFICATION_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.DatabaseHolder.Database
import com.github.libretube.db.obj.WatchPosition import com.github.libretube.db.obj.WatchPosition
import com.github.libretube.extensions.parcelableExtra import com.github.libretube.extensions.parcelableExtra