* Disable http disk cache and implempent in-memory image cache
* Add comment about removing URL scheme prefix
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
* Add early return to clean up the code
* Rewrite cache expiry logic with fallbacks
* Move this change behind a CLI argument --experiments-disable-disk-cache
* Replace CLI flag with a GUI setting
* Improve warning message styling
* ! Fix incompatibility with latest settings code
* Use CSS instead of sass for the experimental settings
* Return the error as JSON instead of throwing it
* Inline restart prompt label and option names and values
* Mention crash risk and recommend backups in the warning
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
* right click menu for open in a new window
* open video in new window when right click
* router link added to channel images for easier selection in the context of a context menu
* fix security bug user can visit other website via freetube
* simplify context menu entry condition
* createWindow in open new window adapted with the merged function
* Change the open new window selector for the origin of the page no matter the name of the website
* Keypress reintegrate into the code for accesibility
* Keypress reintegrate into the code for accesibility
* Fix style for sidenav subscription links
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
* Add system preference to theme-settings
* Add watching logic to check for dark theme settings
* Add en system theme translation
* Add explicit darkTheme option to browserWindow
* Remove unnecessary themeSource line
* Fix lint errors
* Move to using main process messaging for theme change
* Add system dataset selectors for themes
* Fix lint errors
* Change system theme to system default
* Use system default for deciding background color of newWindow
* Add baseTheme to state persistance
* Use baseTheme on browserWindow creation
* Fix lint errors
* Improve window background logic
* Catch settingsDb errors
* Remove dark flash on light themes
* Fix lint issues
* Fix system default sync on multiple windows
* Load database on each new window
* Fix lint errors
* Update compatibility for shared electron storage
* Remove unused console log
* Revert unnecessary changes
* Fix window maximize white flash
* Fix handleBaseTheme usage
* Use data-system-theme instead of data-theme
* Revert window maximize changes
* Fix theme flash on new window open
* ^ Update electron 15.x
* ^ Update electron 15.x > 16.x
This fixes the issue of white flash on new window shown before event `ready-to-show`
even window created with option `backgroundColor`
* * Update `createWindow` to pass options via an object instead of positional arguments
* * Implement windows opening with new window won't be closed when "parent" window closed
* * Update new window opened via middle click to be shown immediately
Matches current behaviour and better user experience (due to elimination of delay from the click to window appearance)
* * Update new window button to show new window faster
* * Only focus on new window on event `ready-to-show` if new window is not already shown
* Update src/main/index.js
Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
* transition duration of 0.5s added to watched videos
* small code reformating
* extra white spaces deleted
* typo in the word transition corrected
* original whitespaces respected
* transition added when hovering end
* video stat components started and properties chosen
* ft-video-stats integraded into the video player for dev and debugging
* using a timer to get video stats and a method to update the statistic every second
* getting statistic from vhs and adaptativeFormat
* frame drop capture
* stats capture in the form of event
* useless comment deleted
* stats render with a for loop in the template
* stats correctly displayed
* overlay stats added
* video stats component deleted
* video stats component deleted inside template video player
* video stats component fully deleted
* modal solution working need more styling and code messy
* lint
* modal working with stats
* keyboard shortcut for stats
* lint fix
* network state is now a string
* new line deleted
* useless whitespace deleted
* package-lock.json remove and ignore
* keyboard shortcut restricted to up arrow
* stats overlay made larger
* align to left corner
* useless formatting of string deleted
* renaming of variable formatedStrats for formattedStats
* keyboard shortcut made into a variable
* lint-fix
* key change for i
* label translated
* whitespace added for gitignore
* lock file not ignored
* videoId stat deleted
* ft-video-player.js, en-US.yaml, fr-FR.yaml: changing percentage stats display
changing the display for percentage stats for the format 'x%' instead of 'xx.xx'
* ft-video-player.js, en-US.yaml, fr-FR.yaml: network state video statistic deleted
* ft-video-player.js: made stats modal background color darker
* ft-video-player.js, en-US.yaml, fr-FR.yaml: video id are now related to the one of youtube
* ft-video-player.js, en-US.yaml, fr-FR.yaml: stats displayed made closet to the youtube implementation
the name are capitalized, the order of display is changed and fps is combined with viewport
* lint-fix
* en-US.yaml, fr-FR.yaml: network state possibilities deleted because not used
* package.json.lock: deleted
* ft-video-player.js: formated_stats renamed for formatted_stats
* lock file deleted
* index.js, ft-video-player.js: handling of right click context menu
via electon ipc bus an event is send to tell the vue component to show the stats modal
* ft-video-player.js, index.js: renaming of video stats display event and definition of it as a variable
* index.js, en-US.yaml: inconsistant capitalization of video statistics label solved
* index.js: pluralized video stats
* ft-video-player.js: fix right click undefined this.player
change the arrow function inside the closure for a function with a bind to this
* ft-video-player.js: handling of the case when this.player is not defined
the property this.stats.display.activated as been added and manage when the to show the stats. In this way in the runtime (it is still refered in the run time but it is capture in an event loop) with dont have to refer to this.player so when it is not defined it doesnt affect the behavior.
* lint fix
* src/renderer/components/ft-video-player/ft-video-player.js: modal.close move into the display event of the statistic context
* lint fix
* src/renderer/components/ft-video-player/ft-video-player.js, static/locales/en-US.yaml, static/locales/fr-FR.yaml: better capitalization of the stats labels
* static/locales/en-US.yaml: fps capitalized
* static/locales/fr-FR.yaml, static/locales/en-US.yaml: capitalized label
* src/renderer/views/History/History.js, src/renderer/store/datastores.js, src/renderer/store/modules/history.js: search history function added and indexing of history database
* npm fix
* src/renderer/views/History/History.js, src/renderer/store/modules/history.js: regex used to handle text search since their is no text indexing
* src/renderer/views/History/History.js, src/renderer/views/History/History.vue: search bar added but not adapted for history search use case
* src/renderer/views/History/History.js, src/renderer/views/History/History.vue: search bar added but not adapted for history search use case
* src/renderer/views/History/History.js, src/renderer/store/modules/history.js, src/renderer/views/History/History.vue: search history working but order do not remain the same depending on search
* src/renderer/views/History/History.js, src/renderer/store/modules/history.js, src/renderer/views/History/History.vue: search history working but order do not remain the same depending on search
* src/renderer/views/History/History.js: loading added when query is empty to order the history
* src/renderer/views/History/History.vue, src/renderer/views/History/History.js, static/locales/en-US.yaml, static/locales/fr-FR.yaml: translation added
* src/renderer/components/ft-list-video/ft-list-video.js, src/renderer/views/History/History.vue, src/renderer/views/History/History.js: fix the bad history reconstruction problem by adding an update hook to ft-list-video component
* lint fix
* src/datastores/handlers/base.js, src/datastores/handlers/electron.js, src/datastores/handlers/web.js, src/datastores/index.js, src/renderer/store/modules/history.js, src/renderer/views/History/History.js, src/constants.js: history adapted to the new db
* src/renderer/store/modules/history.js: print statement deleted
* src/renderer/views/History/History.js, static/locales/en-US.yaml, static/locales/fr-FR.yaml: search history place holder renamed
* search playlists backend
* search bar added into the frontend, search method of playlist deleted because the document are the playlist and not the videos
* src/renderer/store/modules/playlists.js: commment typo resolved
* placeholder name of search bar only defined into the .vue file instead of in the .js file
* src/renderer/components/ft-list-video/ft-list-video.js: fix the mecanism to modify a video card to reflect the current data
* src/renderer/views/History/History.js: doesn't load when query is empty
* src/renderer/components/ft-list-video/ft-list-video.js: fix problem date disapearing
* video id query deleted from search in history and playlist
* 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
* transition duration of 0.5s added to watched videos
* small code reformating
* extra white spaces deleted
* typo in the word transition corrected
* original whitespaces respected
* transition added when hovering end
* video stat components started and properties chosen
* ft-video-stats integraded into the video player for dev and debugging
* using a timer to get video stats and a method to update the statistic every second
* getting statistic from vhs and adaptativeFormat
* frame drop capture
* stats capture in the form of event
* useless comment deleted
* stats render with a for loop in the template
* stats correctly displayed
* overlay stats added
* video stats component deleted
* video stats component deleted inside template video player
* video stats component fully deleted
* modal solution working need more styling and code messy
* lint
* modal working with stats
* keyboard shortcut for stats
* lint fix
* network state is now a string
* new line deleted
* useless whitespace deleted
* package-lock.json remove and ignore
* keyboard shortcut restricted to up arrow
* stats overlay made larger
* align to left corner
* useless formatting of string deleted
* renaming of variable formatedStrats for formattedStats
* keyboard shortcut made into a variable
* lint-fix
* key change for i
* label translated
* whitespace added for gitignore
* lock file not ignored
* videoId stat deleted
* ft-video-player.js, en-US.yaml, fr-FR.yaml: changing percentage stats display
changing the display for percentage stats for the format 'x%' instead of 'xx.xx'
* ft-video-player.js, en-US.yaml, fr-FR.yaml: network state video statistic deleted
* ft-video-player.js: made stats modal background color darker
* ft-video-player.js, en-US.yaml, fr-FR.yaml: video id are now related to the one of youtube
* ft-video-player.js, en-US.yaml, fr-FR.yaml: stats displayed made closet to the youtube implementation
the name are capitalized, the order of display is changed and fps is combined with viewport
* lint-fix
* en-US.yaml, fr-FR.yaml: network state possibilities deleted because not used
* package.json.lock: deleted
* ft-video-player.js: formated_stats renamed for formatted_stats
* lock file deleted
* index.js, ft-video-player.js: handling of right click context menu
via electon ipc bus an event is send to tell the vue component to show the stats modal
* ft-video-player.js, index.js: renaming of video stats display event and definition of it as a variable
* index.js, en-US.yaml: inconsistant capitalization of video statistics label solved
* index.js: pluralized video stats
* ft-video-player.js: fix right click undefined this.player
change the arrow function inside the closure for a function with a bind to this
* ft-video-player.js: handling of the case when this.player is not defined
the property this.stats.display.activated as been added and manage when the to show the stats. In this way in the runtime (it is still refered in the run time but it is capture in an event loop) with dont have to refer to this.player so when it is not defined it doesnt affect the behavior.
* lint fix
* src/renderer/components/ft-video-player/ft-video-player.js: modal.close move into the display event of the statistic context
* lint fix
* src/renderer/components/ft-video-player/ft-video-player.js, static/locales/en-US.yaml, static/locales/fr-FR.yaml: better capitalization of the stats labels
* static/locales/en-US.yaml: fps capitalized
* static/locales/fr-FR.yaml, static/locales/en-US.yaml: capitalized label
* ^ Update electron 13.x > 15.x
* ! Fix child window options due to breaking change in electron 14.x
Breaking change:
https://github.com/electron/electron/pull/28550
Child windows no longer inherit BrowserWindow construction options from their parents.
* Don't blind dark theme users
It is better to start the temporary background dark so it doesnt flashbang dark theme users late at night.
Just happened to me 😢
This makes the loading background color the normal dark theme background color.
* Grab theme before await
* make it consistent when built
* final fixes
* removed accidental file
Co-authored-by: Preston <freetubeapp@protonmail.com>
Electron already has a built-in tracker for all opened windows,
so it makes no sense to have custom code to handle it.
One should always use what is given to you :^)
This commit renames the 'syncSettings' IRC channels to 'syncWindows' and
changes the renderer's listener setup for this channel more generic
so that it can cover other store modules besides the settings' module.
The 'nedb' package is unmaintained (last update was 5 years ago) and
has a couple of high severity vulnerabilities.
In addition, the use of callbacks is somewhat cumbersome for
the project's current workflow.
Therefore, I've decided to replace it with the 'nedb-promises' package,
which, internally, makes use of a maintained fork of 'nedb' and
wraps its API with Promises.
Smooth scrolling toggling is currently wonky on runtime, since,
most of the time, it doesn't toggle on and off properly.
In addition, now that we have multi-window support,
the current implementation was somewhat lacking.
This commit solves those issues by replacing
the existing smooth scrolling related channels with a
new generic `relaunchRequest` channel.
Since the session is shared by all 'BrowserWindow's and
it can be accessed without a window reference,
it's best to clear data when the 'window-all-closed' event is emitted.
With the knowledge that the session is shared by all 'BrowserWindow's,
proxy and cookie related logic can now be set once on startup and
it's not necessary to set them again for every window created.
Previously, the code misleadingly lead developers to believe that
each 'BrowserWindow' had its own isolated session.
This commit clarifies the fact that a global session is shared
by all 'BrowserWindow's by default.
This should fix an issue where, when closing the app, an error window
would very occasionally pop up declaring that 'getNormalBounds'
was called on an undefined variable.
* feat: add support for opening videos/playlists in external players (like mpv) #418
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat: move external player settings into own section
feat: add warnings for when the external player doesn't support the current action (e.g. reversing playlists)
feat: add toggle in settings for ignoring unsupported action warnings
Signed-off-by: Randshot <randshot@norealm.xyz>
* improvement: do not append start offset argument when the watch progress is 0
Signed-off-by: Randshot <randshot@norealm.xyz>
* fix: fix undefined showToast error when clicking on the external player playlist button
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat: add icon button for external player to watch-video-info (below video player) component
improvement: refactor the code for opening the external player into a separate function in utils.js
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat: add support for ytdl protocol urls (supportsYtdlProtocol)
chore: fix lint error
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat: add support for passing default playback rate to external player
improvement: add warning message for when the external player does not support starting playback at
a given offset
chore: rename reverse, shuffle, and loopPlaylist fields for consistency
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat: add setting for custom external player command line arguments
Signed-off-by: Randshot <randshot@norealm.xyz>
* chore: fix lint error
Signed-off-by: Randshot <randshot@norealm.xyz>
* improvement(watch-video-info.js): change the default for playlistId back to null (consistent with other occurrences)
improvement(utils.js/openInExternalPlayer): also check for empty playlistId string
fix(watch-video-info.js): fix merge error
Signed-off-by: Randshot <randshot@norealm.xyz>
* improvement(components/ft-list-video): check whether watch history is turned on, before adding a video to it
fix(store/utils): fix playlistReverse typo, causing `undefined` being set as a command line argument
fix(store/utils): check for 'string' type, instead of `null` and `undefined`
fix(views/Watch): fix getPlaylistIndex returning an incorrect index, when reverse was turned on
chore(locales/en-US): fix thumbnail and suppress typo
chore(locales/en_GB): fix thumbnail and suppress typo
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat: pause player when opening video in external player
Signed-off-by: Randshot <randshot@norealm.xyz>
* feat(externalPlayer): refactor externalPlayerCmdArguments into a separate static file `static/external-player-map.json`
chore(components/ft-list-video): fix lint error
Signed-off-by: Randshot <randshot@norealm.xyz>
* Revert "feat: pause player when opening video in external player"
This reverts commit 28b4713334bf941be9e403abf517bb4b89beb04f.
* feat: pause the app's player when opening video in external player
* This commit addresses above requested changes.
improvement(components/external-player-settings): move `externalPlayer` check to `ft-flex-box`
improvement(components/external-player-settings): use `update*` methods, instead of `handle*`
improvement(store/utils): move child_process invocation to `main/index.js` via IPC call to renderer
improvement(store/utils): use `dispatch` for calling actions
improvement(store/utils): get external player related settings directly in the action
improvement(renderer/App): move `checkExternalPlayer` call down into `usingElectron` if statement
fix(renderer/App): fix lint error
improvement(components/ft-list-playlist): remove unnecessary payload fields
fix(components/ft-list-playlist): fix typo in component name
improvement(components/ft-list-video): remove unnecessary payload fields
improvement(components/watch-video-info): remove unnecessary payload fields
improvement(views/Settings): add `usingElectron` condition
Signed-off-by: Randshot <randshot@norealm.xyz>
* fix(store/utils): fix toast message error
Signed-off-by: Randshot <randshot@norealm.xyz>
* fix(store/utils): fix a few code mess-ups
Co-authored-by: Svallinn <41585298+Svallinn@users.noreply.github.com>
The app utilizes the Electron IPC to communicate settings' updates
to the other existing windows.
This is still at a fairly rudimentary stage, since some settings are
not syncing at all, while other settings have related side effects that
are not currently being propagated to the remaining windows.
An example of this would be the 'uiScale' setting, in which
the value is properly synced, but the app's actual scaling isn't.
This commit removes duplicated handler logic related to the app's
'ready' event. In addition, it rearranges the template used to build the
app's menu in order to make it a bit easier to understand.
The `remote` module is deprecated and `@electron/remote` is unnecessary,
since the `ipcMain` and `ipcRenderer` can replace their functionality,
providing better performance and better security.
All other dangerous calls (mainly pulling main process constructs into
the renderer process) have also been removed.
This prevents the CONSENT cookie from being deleted after a window
is closed by the user, making it so that the user can no
longer load the comment section.
* Bump electron version to 12.0.6
* Move web content clean up logic to window close event
Reference from electron release notes:
> Fixed the window-all-closed event being emitted while the last
BrowserWindow was still in the process of being closed.