From e43e96020f76dbd385d7fb040451626d1f2aaf62 Mon Sep 17 00:00:00 2001 From: chunky programmer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Wed, 3 May 2023 15:20:21 -0400 Subject: [PATCH] Fix sorting upcoming subscriptions --- src/renderer/views/Subscriptions/Subscriptions.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/views/Subscriptions/Subscriptions.js b/src/renderer/views/Subscriptions/Subscriptions.js index 6e34eba38c6f7..c952fa66f0053 100644 --- a/src/renderer/views/Subscriptions/Subscriptions.js +++ b/src/renderer/views/Subscriptions/Subscriptions.js @@ -357,7 +357,13 @@ export default defineComponent({ invidiousAPICall(subscriptionsPayload).then(async (result) => { resolve(await Promise.all(result.videos.map((video) => { - video.publishedDate = new Date(video.published * 1000) + if (video.liveNow) { + video.publishedDate = new Date().getTime() + } else if (video.isUpcoming) { + video.publishedDate = new Date(video.premiereTimestamp * 1000) + } else { + video.publishedDate = new Date(video.published * 1000) + } return video }))) }).catch((err) => {