2018-04-16 01:26:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2019-08-30 02:09:10 +00:00
|
|
|
use App\Media;
|
2024-03-12 07:03:33 +00:00
|
|
|
use Illuminate\Http\Request;
|
2019-08-30 02:09:10 +00:00
|
|
|
|
2018-04-16 01:26:48 +00:00
|
|
|
class MediaController extends Controller
|
|
|
|
{
|
2024-03-12 07:03:33 +00:00
|
|
|
public function index(Request $request)
|
|
|
|
{
|
|
|
|
//return view('settings.drive.index');
|
|
|
|
abort(404);
|
|
|
|
}
|
2019-08-30 02:09:10 +00:00
|
|
|
|
2024-03-12 07:03:33 +00:00
|
|
|
public function composeUpdate(Request $request, $id)
|
|
|
|
{
|
2021-01-18 06:43:23 +00:00
|
|
|
abort(400, 'Endpoint deprecated');
|
2024-03-12 07:03:33 +00:00
|
|
|
}
|
2023-05-23 00:10:55 +00:00
|
|
|
|
2024-03-12 07:03:33 +00:00
|
|
|
public function fallbackRedirect(Request $request, $pid, $mhash, $uhash, $f)
|
|
|
|
{
|
|
|
|
abort_if(! (bool) config_cache('pixelfed.cloud_storage'), 404);
|
|
|
|
$path = 'public/m/_v2/'.$pid.'/'.$mhash.'/'.$uhash.'/'.$f;
|
|
|
|
$media = Media::whereProfileId($pid)
|
|
|
|
->whereMediaPath($path)
|
|
|
|
->whereNotNull('cdn_url')
|
|
|
|
->firstOrFail();
|
2023-05-23 00:10:55 +00:00
|
|
|
|
2024-03-12 07:03:33 +00:00
|
|
|
return redirect()->away($media->cdn_url);
|
|
|
|
}
|
2018-04-16 01:26:48 +00:00
|
|
|
}
|