mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
fix: removed null values from backfill anime responses (#729)
This commit is contained in:
@@ -65,21 +65,15 @@ class PlaylistFactory extends Factory
|
||||
/** @var PlaylistTrack|null $last */
|
||||
$last = Arr::last($tracks);
|
||||
|
||||
$entry = AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->create();
|
||||
|
||||
$video = Video::factory()->create();
|
||||
|
||||
AnimeThemeEntryVideo::query()->create([
|
||||
AnimeThemeEntryVideo::ATTRIBUTE_ENTRY => $entry->getKey(),
|
||||
AnimeThemeEntryVideo::ATTRIBUTE_VIDEO => $video->getKey(),
|
||||
]);
|
||||
$entryVideo = AnimeThemeEntryVideo::factory()
|
||||
->for(AnimeThemeEntry::factory()->for(AnimeTheme::factory()->for(Anime::factory())))
|
||||
->for(Video::factory())
|
||||
->createOne();
|
||||
|
||||
$track = PlaylistTrack::factory()
|
||||
->for($playlist)
|
||||
->for($video)
|
||||
->for($entry)
|
||||
->for($entryVideo->video)
|
||||
->for($entryVideo->animethemeentry)
|
||||
->createOne();
|
||||
|
||||
if ($index === 1) {
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Actions\Models\List\ExternalProfile\StoreExternalProfileAction;
|
||||
use App\Models\List\ExternalProfile;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
/**
|
||||
* Class SimulateExternalProfileSeeder.
|
||||
*/
|
||||
class SimulateExternalProfileSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$action = new StoreExternalProfileAction();
|
||||
|
||||
$validated = [
|
||||
'name' => 'MiltonXerox',
|
||||
'site' => 'AniList',
|
||||
'visibility' => 'Public',
|
||||
'user_id' => 1,
|
||||
];
|
||||
|
||||
$action->store(ExternalProfile::query(), $validated);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Seeder\Wiki;
|
||||
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Class KitsuResourceSeeder.
|
||||
*/
|
||||
class KitsuResourceSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
ExternalResource::query()
|
||||
->where(ExternalResource::ATTRIBUTE_LINK, 'like', 'https://kitsu.io/%')
|
||||
->update([
|
||||
ExternalResource::ATTRIBUTE_LINK => DB::raw("REPLACE(link, 'https://kitsu.io/', 'https://kitsu.app/')")
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user