lekma / plugin.video.invidious

Invidious Addon for Kodi
GNU General Public License v3.0
50 stars 7 forks source link

fix: mark premiere videos as unplayable #96

Open SethFalco opened 1 year ago

SethFalco commented 1 year ago

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:

  1. If a video is marked isUpcoming in the API, it makes the video unplayable.
  2. If the video has a premiereTimestamp, display that in the subplot instead of the view count and publish date.
  3. 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.

image

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.

image

Now that the example video has already past the premiere date, it shows up like any other video and is playable.

Notes

References