api(application): v2 backport

This commit is contained in:
Matthew Penner 2022-12-14 17:05:46 -07:00
parent 4cd0bee231
commit 67bf3e342e
No known key found for this signature in database
172 changed files with 2922 additions and 1579 deletions

View file

@ -11,10 +11,6 @@ use Pterodactyl\Services\Eggs\Sharing\EggUpdateImporterService;
class EggSeeder extends Seeder
{
protected EggImporterService $importerService;
protected EggUpdateImporterService $updateImporterService;
/**
* @var string[]
*/
@ -29,15 +25,15 @@ class EggSeeder extends Seeder
* EggSeeder constructor.
*/
public function __construct(
EggImporterService $importerService,
EggUpdateImporterService $updateImporterService
private EggImporterService $importerService,
private EggUpdateImporterService $updateImporterService
) {
$this->importerService = $importerService;
$this->updateImporterService = $updateImporterService;
}
/**
* Run the egg seeder.
*
* @throws \JsonException
*/
public function run()
{
@ -51,6 +47,8 @@ class EggSeeder extends Seeder
/**
* Loop through the list of egg files and import them.
*
* @throws \JsonException
*/
protected function parseEggFiles(Nest $nest)
{
@ -75,7 +73,7 @@ class EggSeeder extends Seeder
$this->updateImporterService->handle($egg, $file);
$this->command->info('Updated ' . $decoded['name']);
} else {
$this->importerService->handle($file, $nest->id);
$this->importerService->handleFile($nest->id, $file);
$this->command->comment('Created ' . $decoded['name']);
}
}