OsaSoft / youtube-better-subscriptions

This extension for Firefox and Chrome aims to make navigating YouTube's subscription grid easier by allowing users to hide watched videos
GNU General Public License v3.0
116 stars 19 forks source link

Sync watch history #151

Closed mocanew closed 9 months ago

mocanew commented 10 months ago

Fixes #20, #22, #131.

In this PR, the watch history is limited to ~6.5k videos (the limit could be increased if we'd compress the watch history). After this amount is reached, when new entries are added, the oldest entries will be deleted automatically. This way there's no need for a time-based settings to limit the watch history and for most users (other than shorts?), the watch history is basically unlimited.

Added strict_min_version to make sure async/await is supported. Firefox 55 is released in 2017.

Extension's local watch history will be ported automatically and the import feature can use old export files.

OsaSoft commented 10 months ago

🙏 This has been on my TODO since the very first draft of this extension. Thank you. I will take a look at this later tonight

mocanew commented 10 months ago

After going through the channels I've subscribed to and marked the old videos as watched, I realised that 7k is too low a limit. Instead of deleting the watched history over the limit, I would like to save those to local storage. This would mean an "infinite" history size and syncing the newest 7k.

So, for now, this PR should be considered an incomplete draft and should not be published.

OsaSoft commented 10 months ago

Valentin you really are the mvp. Thank you for your massive contributions to my little pet project. Sorry I dont really have the time to go through everything atm. My son just born 😅 Ill get around to everything hopefully sooner rather than later

On Sat, 16 Sept 2023, 00:15 Valentin Mocanu, @.***> wrote:

After going through the channels I've subscribed to and marked the old videos as watched, I realised that 7k is too low a limit. Instead of deleting the watched history over the limit, I would like to save those to local storage. This would mean an "infinite" history size and syncing the newest 7k.

So, for now, this PR should be considered an incomplete draft and should not be published.

— Reply to this email directly, view it on GitHub https://github.com/OsaSoft/youtube-better-subscriptions/pull/151#issuecomment-1721935827, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACD3XZ2QLXDBUM246MBWYLDX2THRTANCNFSM6AAAAAA4NX5DLQ . You are receiving this because you commented.Message ID: @.***>

mocanew commented 9 months ago

Restructured the code so that video operations (watch or unwatch) are saved and synced instead of the entire video watch history. This means that ~6.5k video operations are synced between any user's browsers while a lot more watch history may be present on one specific machine.

The main conceptual difference is that we now store w${videoId} (watched) or n${videoID} (not watched) instead of just the videoId. This way, both types of operations have timestamps associated and can be "prioritised" in the sync storage. As expected, when one type of operation is added to storage, the other type is removed to use as little space as possible.

OsaSoft commented 9 months ago

Nice, thats a great idea. Does this mean this PR is ready now?

mocanew commented 9 months ago

Yes, it's ready to be merged, forgot to mention that :sweat_smile:. I recommend first reviewing and merging #162 and using this PR as a test for the auto-publish workflows.