Added Download file, play for homebrews and ZIP explorer.
This commit is contained in:
@@ -12,13 +12,12 @@ class ToolsController extends Controller
|
||||
|
||||
public function patcher()
|
||||
{
|
||||
|
||||
return view('tools.patcher');
|
||||
}
|
||||
|
||||
public function directPatch( Request $request, int $entryId, EntryFile $file )
|
||||
{
|
||||
if( $file->entry_id != $entryId ) {
|
||||
if( $file->entry_id != $entryId || $file->state === 'private' ) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
@@ -38,22 +37,28 @@ class ToolsController extends Controller
|
||||
|
||||
public function play( Request $request, int $entryId, EntryFile $file )
|
||||
{
|
||||
if( $file->entry_id != $entryId ) {
|
||||
if( $file->entry_id != $entryId || $file->state === 'private' ) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$service = app(FileServersService::class);
|
||||
|
||||
$patches = [
|
||||
'file' => $service->getDownloadFileUrl( $file ),
|
||||
'name' => $file->entry->title,
|
||||
'outputName' => $file->filename
|
||||
];
|
||||
$emuConfig = [
|
||||
'core' => $file->playOnlineSetting?->core,
|
||||
'threads' => $file->playOnlineSetting?->threads,
|
||||
];
|
||||
|
||||
if( $file->entry->type === 'homebrew' ){
|
||||
$filePath = $service->getDownloadFileUrl( $file );
|
||||
|
||||
return view('tools.play-homebrew', compact('filePath', 'emuConfig'));
|
||||
}
|
||||
$patches = [
|
||||
'file' => $service->getDownloadFileUrl( $file ),
|
||||
'name' => $file->entry->title,
|
||||
'outputName' => $file->filename
|
||||
];
|
||||
|
||||
return view('tools.play', compact('patches', 'emuConfig'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user