[Enhancement] Add setting to restrict filenames to ASCII characters (#660)

* Added a new column for restricting filenames

* Adds restrict-filenames to command runner

* Added UI to settings form
This commit is contained in:
Kieran 2025-03-17 14:58:25 -07:00 committed by GitHub
parent ee2db3e9b7
commit 030f5fbdfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 57 additions and 17 deletions

View file

@ -162,6 +162,24 @@ defmodule Pinchflat.YtDlp.CommandRunnerTest do
end
end
describe "run/4 when testing misc options" do
test "includes --restrict-filenames when enabled" do
Settings.set(restrict_filenames: true)
assert {:ok, output} = Runner.run(@media_url, :foo, [], "")
assert String.contains?(output, "--restrict-filenames")
end
test "doesn't include --restrict-filenames when disabled" do
Settings.set(restrict_filenames: false)
assert {:ok, output} = Runner.run(@media_url, :foo, [], "")
refute String.contains?(output, "--restrict-filenames")
end
end
describe "version/0" do
test "adds the version arg" do
assert {:ok, output} = Runner.version()