Previously, if a channel, search result, or feed, featured a premiered video that was still upcoming, the Invidious add-on would show it like any other video, but would throw errors when trying to play it.
There was no indication in the UI that it's a premiered video.
This PR makes three changes:
If a video is marked isUpcoming in the API, it makes the video unplayable.
If the video has a premiereTimestamp, display that in the subplot instead of the view count and publish date.
Make the UI for date times locale and timezone aware.
Screenshots
A feed that includes a channel with an upcoming video. The subplot text of a upcoming video shows "Premieres: " instead of the view count and publish date. Locale is en-GB and timezone is Europe/London.
Same screenshot as above, but with my system timezone locale set to en (probably defaults to en-US) and timezone set to New Zealand.
A channel with an upcoming video. Locale set to en and timezone set to Europe/London.
Information pane is opened while focused on a video.
Now that the example video has already past the premiere date, it shows up like any other video and is playable.
Notes
You'll see the order between the feed and channel videos differs. On YouTube, a channel will show videos in the same order we do. However, I don't have a YouTube account, so in the feed I don't know if we're showing videos in the same order as the YouTube subscription feed does.
I had trouble using __date__ (which afaik delegates to __transform__ internally) because the premiereTimestamp is a conditional attribute. script.module.iapc was throwing exceptions for videos that didn't have it, so I opted to handle transforming it in this plugin.
I originally planned to use relative time to display when the video would premiere, but I opted to follow the YouTube interface, which shows absolute time. However, we need to be timezone aware otherwise users will be confused.
Either the user lives ahead of UTC, so the video still wouldn't be available even after the time passed.
Or the user lives behind UTC, and will wonder how they got late to the party even though they showed up "on time".
Previously, if a channel, search result, or feed, featured a premiered video that was still upcoming, the Invidious add-on would show it like any other video, but would throw errors when trying to play it.
There was no indication in the UI that it's a premiered video.
This PR makes three changes:
isUpcoming
in the API, it makes the video unplayable.premiereTimestamp
, display that in the subplot instead of the view count and publish date.Screenshots
Notes
__date__
(which afaik delegates to__transform__
internally) because thepremiereTimestamp
is a conditional attribute. script.module.iapc was throwing exceptions for videos that didn't have it, so I opted to handle transforming it in this plugin.References