Revert "Less obtuse mounting code"

This reverts commit 9d95c5ab32.
This commit is contained in:
Dane Everitt 2020-08-25 21:54:41 -07:00
parent 0e0b58ba5e
commit ac1559de5e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 23 additions and 89 deletions

View file

@ -9,7 +9,6 @@
namespace Pterodactyl\Services\Servers;
use Pterodactyl\Models\Mount;
use Pterodactyl\Models\Server;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
@ -72,6 +71,17 @@ class ServerConfigurationStructureService
*/
protected function returnCurrentFormat(Server $server)
{
$mounts = $server->mounts;
foreach ($mounts as $mount) {
unset($mount->id);
unset($mount->uuid);
unset($mount->name);
unset($mount->description);
$mount->read_only = $mount->read_only == 1;
unset($mount->user_mountable);
unset($mount->pivot);
}
return [
'uuid' => $server->uuid,
'suspended' => (bool) $server->suspended,
@ -102,9 +112,7 @@ class ServerConfigurationStructureService
],
'mappings' => $server->getAllocationMappings(),
],
'mounts' => $server->mounts->map(function (Mount $mount) {
return $mount->only('uuid', 'source', 'description', 'read_only');
})->toArray(),
'mounts' => $mounts,
];
}