api(application): v2 backport
This commit is contained in:
parent
4cd0bee231
commit
67bf3e342e
172 changed files with 2922 additions and 1579 deletions
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue