Fix audio upload not working on Windows 11 because Windows is the worst operating system which doesn't work properly under any circumstances

This commit is contained in:
celestora 2022-12-13 02:37:00 +02:00
parent 861456964e
commit 7622592290
3 changed files with 5 additions and 2 deletions

View file

@ -123,7 +123,7 @@ class Audio extends Media
$start = time(); $start = time();
while(file_exists($filename)) while(file_exists($filename))
if(time() - $start > 5) if(time() - $start > 5)
exit("Timed out waiting for ffmpeg"); exit("Timed out waiting for ffmpeg"); // TODO replace with exception
} catch(UnknownCommandException $ucex) { } catch(UnknownCommandException $ucex) {
exit(OPENVK_ROOT_CONF["openvk"]["debug"] ? "bash/pwsh is not installed" : VIDEOS_FRIENDLY_ERROR); exit(OPENVK_ROOT_CONF["openvk"]["debug"] ? "bash/pwsh is not installed" : VIDEOS_FRIENDLY_ERROR);

View file

@ -31,7 +31,7 @@ ffmpeg -i $audioFile -f dash -encryption_scheme cenc-aes-ctr -encryption_key $ke
ffmpeg -i $audioFile -vn -ar 44100 "original_$token.mp3" ffmpeg -i $audioFile -vn -ar 44100 "original_$token.mp3"
Move-Item "original_$token.mp3" ($fileHash + '_fragments') Move-Item "original_$token.mp3" ($fileHash + '_fragments')
Move-Item -Path ($fileHash + '_fragments') -Destination "$storageDir/$hashPart" Get-ChildItem -Path ($fileHash + '_fragments/*') | Move-Item -Destination ("$storageDir/$hashPart/$fileHash" + '_fragments')
Move-Item -Path ("$fileHash.mpd") -Destination "$storageDir/$hashPart" Move-Item -Path ("$fileHash.mpd") -Destination "$storageDir/$hashPart"
cd .. cd ..

View file

@ -198,6 +198,9 @@ abstract class OpenVKPresenter extends SimplePresenter
{ {
$user = Authenticator::i()->getUser(); $user = Authenticator::i()->getUser();
if(!$this->template)
$this->template = new \stdClass;
$this->template->isXmas = intval(date('d')) >= 1 && date('m') == 12 || intval(date('d')) <= 15 && date('m') == 1 ? true : false; $this->template->isXmas = intval(date('d')) >= 1 && date('m') == 12 || intval(date('d')) <= 15 && date('m') == 1 ? true : false;
$this->template->isTimezoned = Session::i()->get("_timezoneOffset"); $this->template->isTimezoned = Session::i()->get("_timezoneOffset");