-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added anime synonyms to series scout search (#772)
- Loading branch information
Showing
15 changed files
with
193 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Database\Seeders\Scout; | ||
|
||
use App\Models\List\Playlist; | ||
use App\Models\Wiki\Anime; | ||
use App\Models\Wiki\Anime\AnimeSynonym; | ||
use App\Models\Wiki\Anime\AnimeTheme; | ||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; | ||
use App\Models\Wiki\Artist; | ||
use App\Models\Wiki\Series; | ||
use App\Models\Wiki\Song; | ||
use App\Models\Wiki\Studio; | ||
use App\Models\Wiki\Video; | ||
use Illuminate\Database\Seeder; | ||
use Illuminate\Support\Facades\Artisan; | ||
use Illuminate\Support\Facades\Config; | ||
|
||
/** | ||
* Class ImportModelsSeeder. | ||
*/ | ||
class ImportModelsSeeder extends Seeder | ||
{ | ||
/** | ||
* Seed the application's database. | ||
* | ||
* @return void | ||
*/ | ||
public function run(): void | ||
{ | ||
$driver = Config::get('scout.driver'); | ||
if (empty($driver)) { | ||
$this->command->info('No driver configured for Scout. Skipping models importing.'); | ||
return; | ||
} | ||
|
||
$this->scoutImport(Playlist::class); | ||
$this->scoutImport(Anime::class); | ||
$this->scoutImport(AnimeSynonym::class); | ||
$this->scoutImport(AnimeTheme::class); | ||
$this->scoutImport(AnimeThemeEntry::class); | ||
$this->scoutImport(Artist::class); | ||
$this->scoutImport(Series::class); | ||
$this->scoutImport(Song::class); | ||
$this->scoutImport(Studio::class); | ||
$this->scoutImport(Video::class); | ||
} | ||
|
||
/** | ||
* Call the scout import command for the given model. | ||
* | ||
* @param string $modelClass | ||
* @return void | ||
*/ | ||
private function scoutImport(string $modelClass): void | ||
{ | ||
$this->command->info("Importing Models for {$modelClass}"); | ||
Artisan::call('scout:import', ['model' => $modelClass]); | ||
} | ||
} |
Oops, something went wrong.