Commit Graph

15 Commits

Author SHA1 Message Date
Svallinn daecf944fb
Store Revamp / Full database synchronization across windows (#1833)
* History: Refactor history module

* Profiles: Refactor profiles module

* IPC: Move channel ids to their own file and make them constants

* IPC: Replace single sync channel for one channel per sync type

* Everywhere: Replace default profile id magic strings with constant ref

* Profiles: Refactor `activeProfile` property from store

This commit makes it so that `activeProfile`'s getter returns
the entire profile, while the related update function only needs
the profile id (instead of the previously used array index)
to change the currently active profile.

This change was made due to inconsistency regarding the active profile
when creating new profiles.
If a new profile coincidentally landed in the current active profile's
array index after sorting, the app would mistakenly change to it
without any action from the user apart from the profile's creation.
Turning the profile id into the selector instead solves this issue.

* Revert "Store: Implement history synchronization between windows"

This reverts commit 99b61e6178.

This is necessary for an upcoming improved implementation of the
history synchronization.

* History: Remove unused mutation

* Everywhere: Create abstract database handlers

The project now utilizes abstract handlers to fetch, modify
or otherwise manipulate data from the database.

This facilitates 3 aspects of the app, in addition of
making them future proof:

- Switching database libraries is now trivial
Since most of the app utilizes the abstract handlers, it's incredibly
easily to change to a different DB library.
Hypothetically, all that would need to be done is to simply replace the
the file containing the base handlers, while the rest of the app
would go unchanged.

- Syncing logic between Electron and web is now properly separated
There are now two distinct DB handling APIs: the Electron one and
the web one.
The app doesn't need to manually choose the API, because it's detected
which platform is being utilized on import.

- All Electron windows now share the same database instance
This provides a single source of truth, improving consistency
regarding data manipulation and windows synchronization.

As a sidenote, syncing implementation has been left as is
(web unimplemented; Electron only syncs settings, remaining
datastore syncing will be implemented in the upcoming commits).

* Electron/History: Implement history synchronization

* Profiles: Implement suplementary profile creation logic

* ft-profile-edit: Small fix on profile name missing display

* Electron/Profiles: Implement profile synchronization

* Electron/Playlists: Implement playlist synchronization
2021-12-15 13:42:24 -05:00
Svallinn 40d7278383
Invidious: Randomize instance on startup
There are now two separate settings related to Invidious instances:
- currentInvidiousInstance
- defaultInvidiousInstance

'currentInvidiousInstance' is a value that exists solely in memory
and it's the value used by the app to make the API calls,
while 'defaultInvidiousInstance' is the value that can be persisted
in the database by user action and will be used to initiate
the 'currentInvidiousInstance' on startup.

If the user has not saved a default value to the database,
'currentInvidiousInstance' is randomized from
a fetched list of viable candidates.
2021-07-03 02:55:56 +01:00
Preston a7cd21b7ad Test temporary search fix 2020-10-21 11:15:42 -04:00
Preston a4bdfedd1a Slightly increase delay in loading subscriptions on first boot. 2020-10-07 13:34:09 -04:00
Preston e47b59750d Force RSS Feeds when profile has more than 125 subscribed channels 2020-10-04 18:04:28 -04:00
Preston 70d5b3453f Update Subscription List when changing profiles in a different view 2020-09-28 20:48:20 -04:00
Preston c89f12f04c Update local channel scraper 2020-09-25 21:40:22 -04:00
Preston dea4eba109 Fix and add Locales. Add Reverse playlist functionality 2020-09-09 18:58:35 -04:00
Preston cf3aecb127 Add some error handling to subscriptions 2020-09-03 21:56:01 -04:00
Preston 1bf2e51afc Fix loading for cached subscriptions 2020-09-02 21:04:08 -04:00
Preston f895703446 Fix subscription order for live or streamed videos 2020-09-02 21:00:24 -04:00
Preston 8f35f95a5b Finish Core Subscriptions logic and add more locales to profiles page 2020-09-01 23:21:32 -04:00
Preston 1e035105d1 Finish Profile Logic and working subscriptions 2020-09-01 23:21:32 -04:00
Preston 6c3539943b Show icons in build and remove unused items. 2020-05-27 22:48:41 -04:00
Preston ded6534d16 Push Latest Code to Repository 2020-02-16 13:30:00 -05:00