Merge pull request #4782 from pixelfed/staging

Update app:hashtag-related-generate command, add existing confirmation
pull/4825/head
daniel 2023-11-17 22:45:26 -07:00 zatwierdzone przez GitHub
commit 6eb256860c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ use App\Models\HashtagRelated;
use App\Services\HashtagRelatedService;
use Illuminate\Contracts\Console\PromptsForMissingInput;
use function Laravel\Prompts\multiselect;
use function Laravel\Prompts\confirm;
class HashtagRelatedGenerate extends Command implements PromptsForMissingInput
{
@ -50,6 +51,16 @@ class HashtagRelatedGenerate extends Command implements PromptsForMissingInput
exit;
}
$exists = HashtagRelated::whereHashtagId($hashtag->id)->exists();
if($exists) {
$confirmed = confirm('Found existing related tags, do you want to regenerate them?');
if(!$confirmed) {
$this->error('Aborting...');
exit;
}
}
$this->info('Looking up #' . $tag . '...');
$tags = StatusHashtag::whereHashtagId($hashtag->id)->count();