From e84df9059ee8ef7a23de40dc33740d10d88ab269 Mon Sep 17 00:00:00 2001 From: Kyrch Date: Thu, 5 Mar 2026 17:04:19 -0300 Subject: [PATCH] fix: attempt to fix feature recursion (#1121) --- app/Features/AllowAudioStreams.php | 2 +- app/Features/AllowDumpDownloading.php | 3 ++- app/Features/AllowExternalProfileManagement.php | 2 +- app/Features/AllowPlaylistManagement.php | 4 ++-- app/Features/AllowScriptDownloading.php | 2 +- app/Features/AllowSubmission.php | 2 +- app/Features/AllowVideoStreams.php | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Features/AllowAudioStreams.php b/app/Features/AllowAudioStreams.php index e517f8f43..50e5f9167 100644 --- a/app/Features/AllowAudioStreams.php +++ b/app/Features/AllowAudioStreams.php @@ -16,6 +16,6 @@ class AllowAudioStreams return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } } diff --git a/app/Features/AllowDumpDownloading.php b/app/Features/AllowDumpDownloading.php index 7c79c5cfb..1b55a339f 100644 --- a/app/Features/AllowDumpDownloading.php +++ b/app/Features/AllowDumpDownloading.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Features; +use App\Constants\FeatureConstants; use App\Enums\Auth\SpecialPermission; use App\Models\Auth\User; use Laravel\Pennant\Feature; @@ -16,6 +17,6 @@ class AllowDumpDownloading return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } } diff --git a/app/Features/AllowExternalProfileManagement.php b/app/Features/AllowExternalProfileManagement.php index 0fad6f9b8..340f98ecc 100644 --- a/app/Features/AllowExternalProfileManagement.php +++ b/app/Features/AllowExternalProfileManagement.php @@ -16,6 +16,6 @@ class AllowExternalProfileManagement return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } } diff --git a/app/Features/AllowPlaylistManagement.php b/app/Features/AllowPlaylistManagement.php index 50dde1b21..3755f4fb5 100644 --- a/app/Features/AllowPlaylistManagement.php +++ b/app/Features/AllowPlaylistManagement.php @@ -10,12 +10,12 @@ use Laravel\Pennant\Feature; class AllowPlaylistManagement { - public function resolve(?User $user): bool + public function resolve(?User $user): ?bool { if ($user?->can(SpecialPermission::BYPASS_FEATURE_FLAGS->value)) { return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } } diff --git a/app/Features/AllowScriptDownloading.php b/app/Features/AllowScriptDownloading.php index 298178de0..8af8b5881 100644 --- a/app/Features/AllowScriptDownloading.php +++ b/app/Features/AllowScriptDownloading.php @@ -16,6 +16,6 @@ class AllowScriptDownloading return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } } diff --git a/app/Features/AllowSubmission.php b/app/Features/AllowSubmission.php index ac506dce5..17e98a9d0 100644 --- a/app/Features/AllowSubmission.php +++ b/app/Features/AllowSubmission.php @@ -16,6 +16,6 @@ class AllowSubmission return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } } diff --git a/app/Features/AllowVideoStreams.php b/app/Features/AllowVideoStreams.php index 7993d721e..d46888159 100644 --- a/app/Features/AllowVideoStreams.php +++ b/app/Features/AllowVideoStreams.php @@ -16,6 +16,6 @@ class AllowVideoStreams return true; } - return Feature::for(null)->value(static::class); + return Feature::driver()->get(static::class, null); } }