mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-12 10:04:43 +02:00
8b6b196c99
* feat: migrate encoding scripts from github to platform * style: fix StyleCI finding * fix: don't concatenate updated videos when attempting to attach entry on video upload * fix(api): fix field dependencies & feat(admin): upload script from video detail screen
34 lines
820 B
PHP
34 lines
820 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Wiki\Video\Script;
|
|
|
|
use App\Constants\Config\VideoConstants;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Wiki\Video\VideoScript;
|
|
use Illuminate\Filesystem\FilesystemAdapter;
|
|
use Illuminate\Support\Facades\Config;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
|
|
|
/**
|
|
* Class ScriptController.
|
|
*/
|
|
class ScriptController extends Controller
|
|
{
|
|
/**
|
|
* Download dump.
|
|
*
|
|
* @param VideoScript $script
|
|
* @return StreamedResponse
|
|
*/
|
|
public function show(VideoScript $script): StreamedResponse
|
|
{
|
|
/** @var FilesystemAdapter $fs */
|
|
$fs = Storage::disk(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
|
|
|
return $fs->download($script->path);
|
|
}
|
|
}
|