You've already forked Atomcms-edit
Medium priority fixes: CORS from env, shared HasRadioSettings trait, lazy RconService, validated() fixes, LogoGenerator hardening, DB indexes, user profile consistency, radio rank N+1 fix
This commit is contained in:
@@ -6,7 +6,7 @@ namespace App\Http\Controllers\Radio;
|
||||
|
||||
use App\Enums\RadioSettings;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Miscellaneous\WebsiteSetting;
|
||||
use App\Http\Controllers\Concerns\HasRadioSettings;
|
||||
use App\Services\Community\RadioStreamService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -15,6 +15,7 @@ use Illuminate\View\View;
|
||||
|
||||
class EmbedController extends Controller
|
||||
{
|
||||
use HasRadioSettings;
|
||||
public function __construct(
|
||||
private readonly RadioStreamService $streamService,
|
||||
) {}
|
||||
@@ -53,14 +54,4 @@ class EmbedController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
private function getSetting(RadioSettings|string $key, mixed $default = null): mixed
|
||||
{
|
||||
$keyStr = $key instanceof RadioSettings ? $key->value : $key;
|
||||
|
||||
return Cache::remember("setting_{$keyStr}", 60, function () use ($keyStr, $default): mixed {
|
||||
$websiteSetting = WebsiteSetting::where('key', $keyStr)->first();
|
||||
|
||||
return $websiteSetting?->value ?? $default;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user