isConfigured()) { $this->error('DeepSeek API anahtarı ayarlanmamış.'); return 1; } $limit = (int) $this->option('limit'); $force = $this->option('force'); $query = Anime::where('is_published', true)->with('genres:id,name'); if (!$force) { $query->whereNull('discovery_hook'); } $animes = $query->limit($limit)->get(); if ($animes->isEmpty()) { $this->info('Hook üretilecek anime bulunamadı.'); return 0; } $this->info("Toplam {$animes->count()} anime için hook üretiliyor..."); $bar = $this->output->createProgressBar($animes->count()); $bar->start(); $done = 0; $failed = 0; foreach ($animes as $anime) { $hook = $ai->generateDiscoveryHook($anime); if ($hook) { $anime->updateQuietly(['discovery_hook' => $hook]); $done++; } else { $failed++; } $bar->advance(); usleep(300_000); // Rate limit — 0.3sn ara } $bar->finish(); $this->newLine(); $this->info("Tamamlandı: {$done} başarılı, {$failed} başarısız."); return 0; } }