feat (be podcast): fe connected to be, trying to download podcast episode, save it in cc_files and updating podcast_episodes

This commit is contained in:
Marco Cavalli 2025-07-03 15:39:56 +02:00
parent 2fcde13ef5
commit 2dae6e07e7
10 changed files with 183 additions and 41 deletions

View file

@ -7,6 +7,7 @@ use App\Helpers\LengthFormatter;
use App\Lib\RabbitMQSender;
use App\Models\File;
use App\Models\TrackType;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
@ -48,9 +49,15 @@ class FileController extends Controller
$user = Auth::user();
$apiKey = $request->header('php-auth-user');
//Accept request only from logged-in users
if (!$user) {
throw new \Exception("You must be logged in");
if ($apiKey != 'some_secret_api_key') {
throw new \Exception("You must be logged in");
}
//ToDo: check how to work in Legacy, getting user in this way is quite horrible
$user = User::where('type','=','P')->orderBy('id','ASC')->first();
}
//Mime type list: https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types