Commit Graph

49 Commits

Author SHA1 Message Date
ChunkyProgrammer 43a25f8738
update linters & add stylelint (#3023)
* update linters, add stylelint, switch from sass to scss

* remove unused babel-eslint module

* fix spacing in scss files

* dont use npm in script calls

* dont error for `:deep` selector in css
2023-01-03 19:19:41 +01:00
absidue 7163ddff0c
Escape special characters in channel names in ompl export (#3004) 2022-12-27 10:14:23 +08:00
absidue a88bafeb27
Make getUserDataPath, getPicturesPath and getSystemLocale helpers (#2920) 2022-12-06 12:37:44 +01:00
absidue 8a37692f77
Use native DomParser instead of opml-to-json dependency (#2769)
* Use native DomParser instead of opml-to-json dependency

* Add support for Invidious feed URLs

* Fallback to HTML parser, as HTML is much less strict than XML

* Log error before falling back to the HTML parser
2022-11-15 09:10:51 +01:00
absidue 2b233815ec
Move colours and the colour functions to their own file (#2844) 2022-11-09 05:57:48 +00:00
absidue 8f55a648b1
Cleanup unused component imports (#2773) 2022-10-27 09:34:39 +00:00
Emma 70baa873fb
Move `Dialog` functions to `utils/helpers` (#2752)
* Moving `FileFromDialog` helpers into helpers/utils

* Moving `showDialog` functions to `utils/helpers`

* Linting

* Update src/renderer/helpers/utils.js

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Update refs  `showSaveDialog` in `ft-video-player`

* Formatting long import to be multiline

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

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-10-25 16:44:18 +02:00
Emma 41b3af033b
Implenting `showSaveDialog` in web (#2741)
* Implementing the web callback for `showSaveDialog`

Using the native filesystem API when it is available

* Adding the `writeFileFromDialog` function

It normalizes the behavior of writing to a file handle
given by a file picker between web and electron

* Refactoring `exportFreeTubeSubscriptions`

Now, it should use the profile data stored in memory
rather than reading it from the file system (which may not
be present in web browsers), and it should also work in web
builds

* Refactoring exportYouTubeSubscriptions

Using the `writeFileFromDialog` function instead of `fs`

* Refactoring the rest of the subscription exports

Using the `writeFileFromDialog` function instead of `fs`

* Refactoring exportHistory

- Using the historyCache stored in memory instead of
reading from `fs` to get the history data
- Using `writeFileFromDialog` instead of `fs.writeFile`

* Refactoring exportPlaylists

Using `writeFileFromDialog` instead of `fs`

* Removing no longer needed `fs` import

* Removing something I was using to debug

* Fixing issue with mime types non populating in save picker

* Adding back an unintentionally removed line
2022-10-19 07:50:21 +02:00
absidue f970936d1e
Make copyToClipboard and openExternalLink helpers (#2722) 2022-10-18 08:15:28 +00:00
absidue ad01d2b37d
Make the safe as and open file dialogs blocking (#2712) 2022-10-14 06:00:23 +00:00
absidue 3aa080d707
Make showToast a helper (#2695) 2022-10-14 05:59:49 +00:00
absidue c0f98eeafe
Use named parameters instead of $ and % in localised strings (#2685)
* Use named parameters instead of $ and % in localised strings

* Fix URL warning again

* Update placeholders in most locales

* Let the translators fix the problematic RTL strings

* Fix the missing quotes in some of the YAML files
2022-10-13 11:51:15 +00:00
absidue bc8261d970
Move colours from the store to the utils helper (#2710)
* Move colours from the store to the utils helper

* Use a single array for colours
2022-10-12 06:49:12 +00:00
absidue 22a5062334
Move calculateColorLuminance, calculatePublishedDate and buildVTTFileLocally out of the store (#2692) 2022-10-10 07:45:18 +00:00
ChunkyProgrammer 41fee01217
Improve Importing Subscriptions (#2604)
* improve import

* fix merge conflicts

* dont add duplicate subscriptions, remove redundant "uniqueId"

* Update src/renderer/components/data-settings/data-settings.js

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

* fix unexpected errors

dont show toast when no errors. dont error when already subscribed

* remove check for legacy subscriptions

* rename method

* deduplicate importing code

* remove unused code

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-10-09 03:08:34 +02:00
absidue 63946f7561
Add a settings section component to reduce duplicate code (#2609) 2022-09-24 09:12:11 +00:00
Emma 1512178489
Implementing showOpenDialog's web callback (#2608)
* Implementing the open file dialog in web

- Adding a new function to make loading files
from a dialog box easier in both web and electron

* Canceled should always be false

onchange is only triggered when the file picker
has a file path. If the user cancels, this function
is never called.

* Changing from `function ()` to `() => {`

* Adding a try around processing the history import

* Moving the try-catch to a smaller section

* Adding a listener to when the file picker is closed

* Fixing the grammar on my comment

* Refactoring playlist imports to use readFileFromDialog

* Refactoring handleFreetubeImportFile to use readFileFromDialog

* Refactoring handleYoutubeCsvImportFile to use readFileFromDialog

* Refactoring handleYoutubeImportFile to use readFileFromDialog

* Refactoring importOpmlYoutubeSubscriptions to use readFileFromDialog

* Refactoring importNewPipeSubscriptions to use readFileFromDialog

* Added a check

to prevent resolve from being called multiple times

* Moving the call to removeEventListener

to prevent this event from being triggered twice

* Adding extensions to the web file picker

* Hiding `Check for legacy subscriptions` in web

* Adding comments for better readability

* Correcting my vue syntax
2022-09-23 12:15:49 -04:00
ChunkyProgrammer 7822f7423e
Remove console.logs (#2606)
* remove console.logs

* use 'off' instead of 0
2022-09-23 09:04:10 +08:00
Emma 25d954f990
Cleaning up calls to the Clipboard API (#2597)
* Added a copyToClipboard function to utils

This should make it easier to handle errors which
result from the clipboard API (which are more likely
in web builds). This should also make it easier to handle
copying to clipboard in cordova builds by abstracting the
platform specific code out of the views and moving it
all into one function.

* Moved the $t function out of utils

* Removing locale snippets I was using and am not now

* Added function comment to copyToClipboard

* Adding some missing references

* Adding an additional check

* Re-reviewing my changes, I found a mistake

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

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Update static/locales/en-US.yaml

Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>

* Reverting the language back to what it was previously

* Switching to using i18n.t()

instead of handling the translations myself.
Also, it looks like eslint removed a tab.

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
2022-09-21 15:00:21 +08:00
bob1520 ddce28e586
Feature: Screenshot of video (#2221)
* screenshot

* player settings, jpg & default "pictures" folder

* filename pattern

* folder placeholder update

* remove duplicate action

* update: won't save invalid pattern

* Ask for folder, toggle screenshot, modal showSaveDialog & button unfocus

* useModal
2022-05-30 15:24:34 +02:00
ChunkyProgrammer 2332aafd68
fix csv import/export (#2247) 2022-05-25 10:28:18 +02:00
ChunkyProgrammer 927225d1f4
update yt-channel-info (#2126)
* update yt-channel-info

* update to 3.0.1

* Update yarn.lock
2022-04-05 23:05:15 -04:00
Preston 7651851dbc Fix check for keys in playlist import 2022-02-06 21:00:52 -05:00
Preston f69c53522e Fix issue with importing playlists and fix issue with video bar being incorrect in playlists view 2022-02-06 16:48:24 -05:00
PrestonN d21a7f1c24 Add ability to import / export playlists and slightly tweak settings layout 2022-02-06 14:31:27 -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 044e5bf907
[Feature] Add support for importing/exporting csv YouTube subscriptions + improve speed of reimporting subscriptions (#1543)
* Add support for csv yt subscriptions

* Simplify setting exportFileName

* check if subscribed to channel before making web requests

Co-authored-by: Preston <freetubeapp@protonmail.com>
2021-08-25 07:47:21 +00: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
ChunkyProgrammer 2def271bb2
Settings/Fix: Filter out non-YouTube links in NewPipe imports (#1319) 2021-05-23 15:42:04 +00: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
Svallinn 5f4ea74c16
Prevent deleted history and profile data from being exported
Closes: #934, #937

This assures that the profiles and history datastores are properly
compacted before their respective exports
2021-04-21 05:09:06 +01:00
Svallinn c4afaaaf06
Display error when importing invalid YouTube JSON
Closes: #969

Apparently, every importing option had a proper error message
displayed on a toast... except this one.
Oops.
2021-04-21 03:43:40 +01:00
Luca 58882b3e16 Fix for missing import of marked as watched videos 2021-04-10 22:04:59 +02:00
Preston a3fe91bef5 Update to Webpack 5 and Electron 12 2021-03-02 22:51:01 -05:00
chaptergy bb2dee36b3
Fix OPML import issue (#963)
* Fix OPML import issue

* Fixes linting errors
2021-01-21 14:19:25 -05:00
Preston 6d7d874bc0 Add Proxy configuration to settings. Fix ft-video-list height when using list display 2021-01-14 13:51:33 -05:00
Luca 54b0ea1abc On Import now checks in YouTube subscription json file whether duplicates exist 2020-12-30 20:46:48 +01:00
Preston cd5023ae72 Allow importing / exporting of new subscriptions file from yt 2020-11-01 16:23:06 -05:00
Preston 4240bf9e35 Update Premiere Logic 2020-10-08 21:53:34 -04:00
Preston d19615121d Rework FreeTube subscription import 2020-10-08 21:19:29 -04:00
Preston ffeefe25e0 Add Setting to check for and import legacy subscriptions 2020-10-08 17:35:36 -04:00
Luca 8773ab9661 Fixed error for importing old subscriptions, which added channels to the same profile multiple times 2020-10-07 19:23:18 +02:00
Preston 20e1d80d16 Support gPodder OPML Export files 2020-09-28 19:53:59 -04:00
Preston 4ce826b59e Prevent subscriptions from showing up twice on OPML and NewPipe imports 2020-09-25 21:56:54 -04:00
Preston ffa3788d47 Fix API Callback looping if fallback is enabled 2020-09-16 08:58:39 -04:00
Preston f440a5b38c Fix handling when the channel scraper fails 2020-09-12 16:59:49 -04:00
T-vK 1eaccb22d9 Add support for importing old FreeTube subscription.db files 2020-09-12 10:10:51 +02:00
Preston dea4eba109 Fix and add Locales. Add Reverse playlist functionality 2020-09-09 18:58:35 -04:00
Preston d77c9aed49 Add functionality to import and export subscriptions / history 2020-09-06 18:12:25 -04:00