-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of video published date in video lists #4752
Fix handling of video published date in video lists #4752
Conversation
Seeing the same as Pika Also Something is wrong bc this podcast is live once a week on YT and you will see here that the published date for multiple streams is marked as VirtualBoxVM_ucMWIJgmuK.mp4 |
I had based it on the existing formatting code, which seems to only switch to months when it's above 31 days and doesn't support weeks, so I'll need to change that. |
@PikachuEXE @efb4f5ff-1298-471a-8973-3d47447115dc Those issues should be fixed now :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the same as if you watch it on the watch page. |
Wow im not sure i ever noticed that. To me that doesnt make sense but that is probably out of scope of this PR |
Fixed now (Invidious gives all videos on the popular page the type |
It respects the users chosen locale now, so as you presumably selected |
…h-matching-videos * development: Fix handling of video published date in video lists (FreeTubeApp#4752) Translated using Weblate (Dutch) Translated using Weblate (Chinese (Simplified)) Bump lefthook from 1.6.4 to 1.6.5 (FreeTubeApp#4758) Bump marked from 12.0.0 to 12.0.1 (FreeTubeApp#4757) Bump electron from 29.1.0 to 29.1.1 (FreeTubeApp#4756) Translated using Weblate (Portuguese) Translated using Weblate (Portuguese (Brazil)) Improve touch controls for dash quality selector (FreeTubeApp#4750) Translated using Weblate (Serbian) Translated using Weblate (Spanish) Translated using Weblate (French) Translated using Weblate (German) Translated using Weblate (Estonian)
* development: (28 commits) Fix handling of video published date in video lists (FreeTubeApp#4752) Translated using Weblate (Dutch) Translated using Weblate (Chinese (Simplified)) Bump lefthook from 1.6.4 to 1.6.5 (FreeTubeApp#4758) Bump marked from 12.0.0 to 12.0.1 (FreeTubeApp#4757) Bump electron from 29.1.0 to 29.1.1 (FreeTubeApp#4756) Translated using Weblate (Portuguese) Translated using Weblate (Portuguese (Brazil)) Improve touch controls for dash quality selector (FreeTubeApp#4750) Translated using Weblate (Serbian) Translated using Weblate (Spanish) Translated using Weblate (French) Translated using Weblate (German) Translated using Weblate (Estonian) Translated using Weblate (Polish) Translated using Weblate (Basque) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Portuguese (Brazil)) Fix playlists database import and export not using the actual database format (FreeTubeApp#4664) ... # Conflicts: # src/renderer/views/Search/Search.js
Fix handling of video published date in video lists
Pull Request Type
Related issue
Fixes #4541 (not sure if GitHub automatically closes discussions with pull requests but I'm listing it here anyway)
Fixes #2579
Closes #3736
Description
This started as an investigation into #4541 (FreeTube showing published dates in German, despite the display language being set to English) and in the process of fixing that, I ended up solving #2579 and implementing #3736.
The issue with the translated published strings was because we were using the
publishedText
property in Invidious' API response, which it turns out is a translatable string on the Invidious side, so when an instance likeinvidious.nerdvpn.de
decides to randomly return German translations for no apparent reason, FreeTube bugs out and shows that to the user. The solution to that is using thepublished
property instead, which contains Invidious' parsing of thepublishedText
into a unix timestamp in milliseconds.As I was switching to the
published
field for Invidious anyway, I decided I might as well do it for the local API too, that means parsing the relative date strings during the local API parsing, so thatft-list-video
only has to deal with unix timestamps. Converting it back to a relative timestamp is then done inft-list-video
based on the current date and time. One major benefit of doing that, is that when we save videos in the subscription cache, they are no longer saved with10 minutes ago
, instead they have the unix timestamp, so instead of only being able to show10 minutes
ago when it is restored from the cache 3 hours later, it will now show3 hours ago
.Please note that as these timestamps are calculated based on relative timestamps, they might not match up with YouTube's, as they have access to the absolute timestamp in their databases. However showing a potentially slightly off relative timestamp is a lot better than still showing
10 minutes ago
3 hours after the video was published.The mark as watched invalid date issue was caused by us saving the text
"10 minutes ago"
in the watch history, but as we save the unix timestamp on the watch page, the code that read the date from the history was expecting a unix timestamp, which"10 mins ago"
most certainly is not. The solution to that was quite easy now that the rest of theft-list-video
component was already using unix timestamps.Testing
Invalid date
This pull request doesn't change how published dates are handled for community posts, but I will switch that to the
published
field in a follow up pull request, so we get the same updated timestamps when we restore it from the cache.Desktop