Commit Graph

74 Commits

Author SHA1 Message Date
absidue 65d36852ff
Fix right clicking on links being treated as link clicks (#2355) 2022-06-30 14:53:15 -04:00
PikachuEXE 2db528b8dd
! Fix handling of youtube link middle mouse click (#2083)
To properly open new windows
2022-05-30 14:32:38 -04:00
preston 20a65a6400 Fix small errors that would come up during usage 2022-05-14 21:05:14 -04:00
vallode 3dcea52b75
System theme preference (#1800)
* 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
2022-05-11 10:30:40 -04:00
absidue 4ef26df7a0
Add the alternate search keyboard shortcuts COMMAND+L on MacOS and CTRL+L on other platforms (#2175) 2022-04-09 15:43:17 -04:00
vallode 86bdb5e2ae
Fix search input shortcut (#2140)
* Add handler for slash shortcut

* Fix lint errors

* Change Slash shortcut to Alt+KeyD
2022-04-07 22:45:22 -04:00
absidue 048b7bc77e
Only fetch the most recent update from the GitHub releases (#2169) 2022-04-07 22:03:28 -04:00
vallode 815c348948
Sync theme between windows (#2090)
* Sync expandSideBar across tabs

* Sync baseTheme, mainColor, secColor between windows

* Fix lint errors

* Fix lint errors: electric boogaloo
2022-03-05 03:09:32 -05:00
Preston 9a7b260859 Update marked syntax in update checker 2022-02-06 18:16:46 -05:00
PrestonN 2be2301d92 Prevent middle click from opening URLs within the app 2022-01-10 21:16:50 -05:00
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
ChunkyProgrammer 9bf4742cf9
Recognize more channel links (#1455)
* Update channelPattern regex

* redirect to relevant sub page

* Simplify regex

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* fix regression

- fix regression from commit 76f0d7512a
- add comment to explain regex

Co-authored-by: Preston <freetubeapp@protonmail.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2021-11-02 11:45:50 +00:00
ChunkyProgrammer c25997c804
fix: white screen when invidious instances don't load (#1755)
* fix white screen when invidious instances don't load

* static file for instances on api fail

* Update src/renderer/store/modules/invidious.js

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* only parse json if file exists

* fix linter

* Update src/renderer/store/modules/invidious.js

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* Update src/renderer/store/modules/invidious.js

* Update invidious.js

* Update src/renderer/store/modules/invidious.js

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* remove trailing space

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2021-11-02 11:42:24 +00:00
peepopoggers 25189e2aff
Don't blind dark theme users (Dark loading screen) (#1502)
* 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>
2021-10-01 12:12:35 +00:00
PikachuEXE f931092b96
* Implement setting for disabling external link opening (#1427)
* * Implement setting for disabling external link opening

* * Implement setting for disabling external link opening in dropdown

* * Place proper tooltip content on setting tooltip

* Implement "open link after prompt"

* Fix new setting placement and long translation entry value issue

* fix via increasing width instead of truncating text

* * Access new perference via computed property

* ~ Move the code comment back to original place

* * Update prompt to show URL

* Fix missing :key for element with v-for

* Do Nothing > No Action

* $ Use shortcut to preference value in conditional statements

* Update translation text

* move and update tooltip text

* Rename "Open Link After Prompt" > "Ask Before Opening Link"

Also fix the translation value
2021-09-16 19:03:25 -04:00
Jason 59828a101d
Implements color clues for history navigation arrows (#1579)
Co-authored-by: Preston <freetubeapp@protonmail.com>
2021-09-16 22:58:03 +00:00
PikachuEXE 1ff6617ff2
* Update app to hide top nav filter panel on page change (#1479) 2021-09-13 18:26:08 +01:00
PrestonN 0db6dd1f97 Fix update checker, bump version number, and update node modules 2021-09-01 16:31:20 -04:00
ChunkyProgrammer 93a48ffe24
Translate window titles (#1321)
* Update Titles to change based on locale

* Update Title on Forward/Backwards navigation

* Revert "Update Title on Forward/Backwards navigation"

This reverts commit 0a57825e92.

* Translate Window Titles

-Updated en-US & en_GB localization files to include 'Playlist" and "Profile Settings"
- Updated app to dynamically change titles + translate (App.js sets title instead of router now)
- Channel & Video get title based on Channel Name & Video name (changing those titles are in their respective views)

* Revert "Update Titles to change based on locale"

This reverts commit 9e80816067.

* Re-add update title to channel view

* fix playlist title

* Fix 'Edit Profile' title
2021-07-21 11:45:02 -04:00
Svallinn 2ce3110041
Main: Move window bounds persistence logic over to the main process 2021-07-03 03:43:49 +01: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
Svallinn b68e1700c0
Main+Renderer: Make IRC window syncing channels more generic
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.
2021-06-26 05:06:18 +01:00
Svallinn 9859a7ce18
App+Settings: Make locale changes reactive between windows
This commit moves the locale relevant code to the settings' store module
and incorporates it with its current architecture.

I should clarify that this makes the value present in the `localStorage`
nonmeaningful, as that value is no longer being used in any way.
2021-06-20 02:47:44 +01:00
Svallinn 73c198a30c
Chore: Replace `markdown` package with `marked`
The 'markdown' package is unmaintained (last update was 8 years ago)
and has a low severity vulnerability, so it makes sense to replace it
with 'marked', which is actively maintained and very small in size.
2021-06-17 04:14:06 +01:00
Svallinn 0551ce44f2
Main+Renderer: Enforce synchronous messages on `setBounds` channel
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.
2021-06-16 05:34:37 +01:00
kuhaku 52fa523df1
Add support for External Players (closes #418) (#1271)
* 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 28b4713334.

* 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>
2021-06-13 17:31:43 +02:00
Svallinn 7e94abb3b4
Main+App+Store: Implement basic setting sync between Electron windows
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.
2021-06-11 02:56:39 +01:00
Svallinn 08cf749277
App: Remove unnecessary leftover artifacts 2021-06-11 02:56:38 +01:00
Svallinn 0bd75d558f
App: Remove unnecessary logic related to the `usingElectron` setting 2021-06-07 15:22:48 +01:00
PikachuEXE a3cf210fca
Update Youtube URL handling to recongnize playlist ID in URL (#1260)
* * Update Youtube URL handling to recongnize playlist ID in URL

Only for format of `https://www.youtube.com/watch?v=vid&list=lid`

* ! Fix vue component prop declaration

A prop where the value can be undefined cannot be declared "required"
2021-05-31 13:23:35 +02:00
PikachuEXE 70aa159bb8
Update "Open Link" button to include playlist ID (#1258)
* ! Fix app unable to load due to missing `getLocale` in `mapActions`

* $ Update a function's name with incorrect name casing

* Update "open youtube link" button to open with playlist when playing a video with an active playlist
2021-05-25 19:39:34 +02:00
Svallinn 6ccc7e9fa4
Refactor: Swap `dispatch`/`commit` calls with mapped actions/mutations 2021-05-22 00:56:32 +01:00
Svallinn e72fbcf0a4
Refactor: Remove all `v` delegate variables 2021-05-22 00:52:11 +01:00
Svallinn af0353ea32
Refactor: Erase `@electron/remote` references and other dangerous calls
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.
2021-05-22 00:49:48 +01:00
Preston 785e7b15bb Remove this.currentLocale 2021-05-06 23:06:56 -04:00
Preston 8e4fe4eacb Re-Arrange System Default Locale logic 2021-05-06 22:59:37 -04:00
PikachuEXE 82aeaac734
* Update top nav search input to direct to channel panel when channel URL provided (#1221)
* $ Extract function which extract details from a Youtube URL

* * Update top nav handling to use extract function to handle input text if it's Youtube URL

* - Remove no longer used function
2021-04-28 19:21:16 +02:00
Svallinn 61b2fc4b48
Improve YouTube link handler
* Handle /user channel URL type
* Fix minor problems with the regexps
* Display informational toasts for hashtag and unknown URL types
* Add toast messages to the default locale
2021-04-25 01:28:29 +01:00
Svallinn 78324ff775
Handle other url types from freetube:// protocol
Closes: #1207

The app was mistakenly only set up to handle video type urls from
the freetube:// protocol.
It should now be able to additionally handle playlist, search and
channel type as well.
2021-04-21 02:07:26 +01:00
Svallinn 52e600dc13
Bugfix: load of subscriptions at startup (#1216) 2021-04-20 18:07:47 +00:00
Svallinn f9f49a5f6d
Link app views to related YouTube url navigations 2021-03-30 03:32:17 +01:00
Luca 271a45e2b0 Cleanup 2021-03-27 18:58:14 +01:00
Luca 4e11233f3e Verify check 2021-03-26 19:30:44 +01:00
Luca 24d12a4357 Started investigating default profile loading inconsistency 2021-03-19 12:05:25 +01:00
Svallinn 7eda649293
Support for the 't' parameter in links (#1090)
This allows users to specify the timestamp of a video (in seconds)
- by inputting a link into the search bar
- by making use of the protocol link (freetube://), p.e in a browser
2021-03-06 14:03:40 -05:00
Hiers 215ae68b56
Changed command line input to only allows youtube video links. (#1073)
* Changed command line input to only allows youtube video links.

* Changed URL logic in renderer/App.js instead of making restriction in index.js.
2021-02-28 16:37:18 -05:00
Preston 659415edc3 Initial Playlist implementation. Functions like basic favorites list 2021-01-14 18:03:23 -05:00
Preston 57b004431f Add better release check logic 2020-12-18 11:57:20 -05:00
Preston f75df62c90 Move logic to utils store and load country data on boot 2020-10-22 14:56:49 -04:00
Colin Fleming 6466860eb8
Fix freetube:// protocol handling on macOS. (#669)
1. Handle open-url events.
2. Make protocol handling more robust on Win/Linux based on SO post.
3. Change 'ping' message to more descriptive 'openUrl' message.
4. Remove freetube:// protocol in main, and unify URL handling logic.
2020-10-15 09:33:25 -04:00