iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.46k stars 1.85k forks source link

[Enhancement] Help users identify videos whose title has changed unexpectedly. #5007

Closed mk-pmb closed 1 month ago

mk-pmb commented 1 month ago

Is your enhancement request related to a problem? Please describe. Sometimes when I open video links from the popular feed in background tabs, it creates tabs that will later confuse me because the video title doesn't match any of the titles I had seen (and opened) from the feed page.

Usually it turns out that the unexpected tab was one of the videos I opened, but the title has changed. Probably a caching / race condition issue. I don't know whether it also affects thumbnails because I don't load the preview image on the video details page.

I vaguely remember having encountered that phenomenon with search results, too. Might also affect playlists, but I can't recall encountering it there.

Describe the solution you'd like When generating the video details page, we should scan all available caches for alternative titles and thumbnails that we may know, and display them somehow. (Maybe below the title add something like "This video has been found to have had other titles before: • (date) (title) • (date) (title) …")

Describe alternatives you've considered

Additional context

unixfox commented 1 month ago

That's out of scope.

First we recommend cleaning the cache every day so this feature won't work. Second invidious tries to replicate the features of youtube, not being a tool that tries to add many features that doesn't exist in youtube.

mk-pmb commented 1 month ago

We may have a misunderstanding. I was speaking of server-side caches. On YouTube, as far as I know, search results, plasylists etc. always show the latest video title.

unixfox commented 1 month ago

First we recommend cleaning the cache every day so this feature won't work.

-> First we recommend cleaning the server cache every day so this feature won't work.

mk-pmb commented 1 month ago

Sorry if I'm missing something obvious. Please help me understand why it "won't work". The only failure I can see is a race condition:

  1. User requests popular feed (or search results, or playlist, …)
  2. Server replies, reply includes a link to video V1 with title T1
  3. Time passes
  4. User clicks on link titled T1
  5. Browser requests details page for V1
  6. Server replies, reply has the title as T2 totally different from T1

In case the cache is cleared between 2 and 6, we're out of luck for the solution considered above. (The stopgap would still work but has other drawbacks, off-topic in this issue.)

With daily cache clear, and assuming reasonably short time gaps, most of the day the server should (in step 6) still be able to access T1 from step 2. This could make the confusion described a very rare experience.

unixfox commented 1 month ago

Oops that's worse than that. Invidious automatically clear the cache every hour: https://github.com/iv-org/invidious/blob/master/src/invidious/jobs/clear_expired_items_job.cr

Your only way to get this feature working reliably is through localstorage.