Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ft-input-tags for external player custom args #6221

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

absidue
Copy link
Member

@absidue absidue commented Nov 24, 2024

Use ft-input-tags for external player custom args

Pull Request Type

  • Feature Implementation

Description

It's not uncommon for users to struggle to configure the external player settings correctly. One of the known stumbling blocks is that people don't read the tooltips, so don't realise that they have to separate the custom arguments with a semicolon (;). This pull request changes the custom arguments to use the ft-input-tags component, that way users can enter each argument separately, which should hopefully make it easier to configure the custom arguments correctly. Interally we now store the args in a JSON array.

I updated the tooltip text to remove the separated by semicolons (';'), part in most languages where it was obvious which part of the text it is, in other languages where it was less obvious to me (as I don't know many of FreeTube's languages) I left it to be changed by the translators. At least some of them will have less work to do :).

Screenshots

external-player-custom-args

Testing

So that you don't have to install various external players, I would suggest editing the openInExternalPlayer function in src/renderer/store/modules/utils.js to log what it would send to the external player instead of launching it e.g.

-    if (process.env.IS_ELECTRON) {
-      const { ipcRenderer } = require('electron')
-      ipcRenderer.send(IpcChannels.OPEN_IN_EXTERNAL_PLAYER, { executable, args })
-    }
+    console.log(executable, args)

Testing the migration

Check that the migration of the old args string to the new JSON string works correctly

  1. While FreeTube is not running open your settings.db file (data location but in the Electron instead of FreeTube folder)
  2. If you didn't have any args configured previously add this line, otherwise edit the existing one: {"_id":"externalPlayerCustomArgs","value":"--test1;--test2"}
  3. Run yarn dev on this branch
  4. Check in the external player settings that the two args show up as two separate tags

Other tests

  1. Set some custom args
  2. Click on the open in external player button on the watch page or in a video list, in the console your custom args should be correctly mixed in with the one that FreeTube sets

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: a3823c5

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 24, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 24, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: waiting for review For PRs that are complete, tested, and ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants