From 2e8350ce1a8326866ea020597a89fd93c72a9193 Mon Sep 17 00:00:00 2001 From: bellington3 <71927099+bellington3@users.noreply.github.com> Date: Tue, 29 Sep 2020 22:07:20 +0000 Subject: [PATCH] Provide config toggle to set 'audio' conversion on as default (#310) * Provide config toggle to set 'audio' conversion on as default * Fix git cherry pick mistake * Update templates/index.tpl Co-authored-by: Pierre Rudloff * Add default audio config option to config.example Co-authored-by: Pierre Rudloff --- classes/Config.php | 7 +++++++ config/config.example.yml | 3 +++ templates/index.tpl | 2 +- tests/ConfigTest.php | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index c2fd010..56a0fe4 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -140,6 +140,13 @@ class Config */ public $debug = false; + /** + * Default to audio. + * + * @var bool + */ + public $defaultAudio = false; + /** * Config constructor. * diff --git a/config/config.example.yml b/config/config.example.yml index 8aeb99a..29511a2 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -55,3 +55,6 @@ genericFormats: # Enable debug mode. debug: false + +# True to enable audio conversion mode by default +defaultAudio: false diff --git a/templates/index.tpl b/templates/index.tpl index 21e11d4..c606933 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -20,7 +20,7 @@ {if $config->convert}
- + defaultAudio) ? 'checked' : ''}> diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index e0fe7d8..5677e5c 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -75,6 +75,7 @@ class ConfigTest extends BaseTest $this->assertIsBool($config->uglyUrls); $this->assertIsBool($config->stream); $this->assertIsBool($config->remux); + $this->assertIsBool($config->defaultAudio); $this->assertIsInt($config->audioBitrate); }