From dae5605098ce2a85508214ef7348713eb671f896 Mon Sep 17 00:00:00 2001 From: Phan An Date: Sun, 14 Jul 2024 14:17:22 +0200 Subject: [PATCH] chore(plus): add a warning when multiple keys found --- app/Console/Commands/CheckLicenseStatusCommand.php | 5 +++++ docs/troubleshooting.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/Console/Commands/CheckLicenseStatusCommand.php b/app/Console/Commands/CheckLicenseStatusCommand.php index ae5d1faa..f0782120 100644 --- a/app/Console/Commands/CheckLicenseStatusCommand.php +++ b/app/Console/Commands/CheckLicenseStatusCommand.php @@ -3,6 +3,7 @@ namespace App\Console\Commands; use App\Enums\LicenseStatus; +use App\Models\License; use App\Services\License\Contracts\LicenseServiceInterface; use Illuminate\Console\Command; use Throwable; @@ -21,6 +22,10 @@ class CheckLicenseStatusCommand extends Command { $this->components->info('Checking your Koel Plus license status…'); + if (License::count() > 1) { + $this->components->warn('Multiple licenses found. This can cause unexpected behaviors.'); + } + try { $status = $this->licenseService->getStatus(checkCache: false); diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 9728121a..814316c7 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -62,6 +62,11 @@ Solution: This most likely has little to do with Koel but more with your node/np Solution: This may sometimes happen with the native PHP streaming method. Check [Streaming Music](usage/streaming) for alternatives. +### You receive a `Multiple licenses found` warning when running `koel:license:status` command + +Solution: Koel Plus only requires one license key. If it detects more than one key in the database, the warning will be issued. +Most of the time this shouldn't cause any problem, but if you're experiencing issues, try emptying the `licenses` table and re-activating your license key. + ## Reinstalling Koel In the worst case scenario, you can always reinstall Koel. Although Koel doesn't provide a built-in way to reinstall itself, you can do so manually by following these steps: