diff --git a/classes/Config.php b/classes/Config.php index 56a0fe4..48625a1 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -147,6 +147,13 @@ class Config */ public $defaultAudio = false; + /** + * Disable audio conversion from/to seeker. + * + * @var bool + */ + public $convertSeek = true; + /** * Config constructor. * diff --git a/classes/Controller/DownloadController.php b/classes/Controller/DownloadController.php index 834f48d..e3c547c 100644 --- a/classes/Controller/DownloadController.php +++ b/classes/Controller/DownloadController.php @@ -101,8 +101,12 @@ class DownloadController extends BaseController */ private function getConvertedAudioResponse(Request $request, Response $response) { - $from = $request->getQueryParam('from'); - $to = $request->getQueryParam('to'); + $from = null; + $to = null; + if ($this->config->convertSeek) { + $from = $request->getQueryParam('from'); + $to = $request->getQueryParam('to'); + } $response = $response->withHeader( 'Content-Disposition', diff --git a/config/config.example.yml b/config/config.example.yml index 29511a2..3ce5614 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -58,3 +58,6 @@ debug: false # True to enable audio conversion mode by default defaultAudio: false + +# False to disable convert seek functionality +convertSeek: true diff --git a/templates/index.tpl b/templates/index.tpl index c606933..b26eb64 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -24,6 +24,7 @@ + {if $config->convertSeek}
{t}to{/t}
+ {/if} {/if} diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 5677e5c..d4c8359 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -76,6 +76,7 @@ class ConfigTest extends BaseTest $this->assertIsBool($config->stream); $this->assertIsBool($config->remux); $this->assertIsBool($config->defaultAudio); + $this->assertIsBool($config->convertSeek); $this->assertIsInt($config->audioBitrate); }