minor chages;

This commit is contained in:
huangjx
2022-04-29 22:49:59 +08:00
parent 3a13bfa244
commit 6195928b74
8 changed files with 19 additions and 18 deletions

View File

@@ -202,7 +202,8 @@ class MainController extends Controller
*/
public function scanFolder()
{
$resp = folderScan::sync();
$force = $this->request->getParam('force') ?? false;
$resp = $force ? folderScan::create()->scan() : folderScan::sync();
return new JSONResponse($resp);
}
/**

View File

@@ -81,10 +81,9 @@ class YoutubeController extends Controller
$url = trim($this->request->getParam('text-input-value'));
$yt = $this->youtube;
if (in_array($this->request->getParam('extension'), $this->audio_extensions)) {
$yt->audioOnly = TRUE;
$yt->audioOnly = true;
$yt->audioFormat = $this->request->getParam('extension');
} else {
$yt->audioOnly = FALSE;
$yt->videoFormat = $this->request->getParam('extension');
}
if (!$yt->isInstalled()) {
@@ -158,10 +157,10 @@ class YoutubeController extends Controller
if (!empty($data['link'])) {
if (isset($data['ext'])) {
if (in_array($data['ext'], $this->audio_extensions)) {
$this->youtube->audioOnly = TRUE;
$this->youtube->audioOnly = true;
$this->youtube->audioFormat = $data['ext'];
} else {
$this->youtube->audioOnly = FALSE;
$this->youtube->audioOnly = false;
$this->youtube->videoFormat = $data['ext'];
}
}