mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-02 08:19:33 -05:00
Apply fixes from StyleCI
This commit is contained in:
@@ -38,41 +38,41 @@ class TorrentResource extends JsonResource
|
||||
'type' => 'torrent',
|
||||
'id' => (string) $this->id,
|
||||
'attributes' => [
|
||||
'poster' => isset($meta->poster) ? \tmdb_image('poster_small', $meta->poster) : 'https://via.placeholder.com/90x135',
|
||||
'name' => $this->name,
|
||||
'release_year' => $this->release_year,
|
||||
'category' => $this->category->name,
|
||||
'type' => $this->type->name,
|
||||
'resolution' => $this->when(isset($this->resolution_id), $this->resolution->name ?? ''),
|
||||
'distributor' => $this->when(isset($this->distributor_id), $this->distributor->name ?? ''),
|
||||
'region' => $this->when(isset($this->region_id), $this->region->name ?? ''),
|
||||
'media_info' => $this->mediainfo,
|
||||
'bd_info' => $this->bdinfo,
|
||||
'description' => $this->description,
|
||||
'info_hash' => $this->info_hash,
|
||||
'size' => $this->size,
|
||||
'poster' => isset($meta->poster) ? \tmdb_image('poster_small', $meta->poster) : 'https://via.placeholder.com/90x135',
|
||||
'name' => $this->name,
|
||||
'release_year' => $this->release_year,
|
||||
'category' => $this->category->name,
|
||||
'type' => $this->type->name,
|
||||
'resolution' => $this->when(isset($this->resolution_id), $this->resolution->name ?? ''),
|
||||
'distributor' => $this->when(isset($this->distributor_id), $this->distributor->name ?? ''),
|
||||
'region' => $this->when(isset($this->region_id), $this->region->name ?? ''),
|
||||
'media_info' => $this->mediainfo,
|
||||
'bd_info' => $this->bdinfo,
|
||||
'description' => $this->description,
|
||||
'info_hash' => $this->info_hash,
|
||||
'size' => $this->size,
|
||||
'num_file' => $this->num_file,
|
||||
'freeleech' => $this->free.'%',
|
||||
'double_upload' => $this->doubleup,
|
||||
'internal' => $this->internal,
|
||||
'uploader' => $this->anon ? 'Anonymous' : $this->user->username,
|
||||
'seeders' => $this->seeders,
|
||||
'leechers' => $this->leechers,
|
||||
'times_completed' => $this->times_completed,
|
||||
'tmdb_id' => $this->tmdb,
|
||||
'imdb_id' => $this->imdb,
|
||||
'tvdb_id' => $this->tvdb,
|
||||
'mal_id' => $this->mal,
|
||||
'igdb_id' => $this->igdb,
|
||||
'category_id' => $this->category_id,
|
||||
'type_id' => $this->type_id,
|
||||
'resolution_id' => $this->when($this->resolution_id !== null, $this->resolution_id),
|
||||
'distributor_id' => $this->when($this->distributor_id !== null, $this->distributor_id),
|
||||
'region_id' => $this->when($this->region_id !== null, $this->region_id),
|
||||
'created_at' => $this->created_at,
|
||||
'download_link' => \route('torrent.download.rsskey', ['id' => $this->id, 'rsskey' => \auth('api')->user()->rsskey]),
|
||||
'magnet_link' => $this->when(\config('torrent.magnet') === true, 'magnet:?dn='.$this->name.'&xt=urn:btih:'.$this->info_hash.'&as='.route('torrent.download.rsskey', ['id' => $this->id, 'rsskey' => \auth('api')->user()->rsskey]).'&tr='.route('announce', ['passkey' => \auth('api')->user()->passkey]).'&xl='.$this->size),
|
||||
'details_link' => \route('torrent', ['id' => $this->id]),
|
||||
'freeleech' => $this->free.'%',
|
||||
'double_upload' => $this->doubleup,
|
||||
'internal' => $this->internal,
|
||||
'uploader' => $this->anon ? 'Anonymous' : $this->user->username,
|
||||
'seeders' => $this->seeders,
|
||||
'leechers' => $this->leechers,
|
||||
'times_completed' => $this->times_completed,
|
||||
'tmdb_id' => $this->tmdb,
|
||||
'imdb_id' => $this->imdb,
|
||||
'tvdb_id' => $this->tvdb,
|
||||
'mal_id' => $this->mal,
|
||||
'igdb_id' => $this->igdb,
|
||||
'category_id' => $this->category_id,
|
||||
'type_id' => $this->type_id,
|
||||
'resolution_id' => $this->when($this->resolution_id !== null, $this->resolution_id),
|
||||
'distributor_id' => $this->when($this->distributor_id !== null, $this->distributor_id),
|
||||
'region_id' => $this->when($this->region_id !== null, $this->region_id),
|
||||
'created_at' => $this->created_at,
|
||||
'download_link' => \route('torrent.download.rsskey', ['id' => $this->id, 'rsskey' => \auth('api')->user()->rsskey]),
|
||||
'magnet_link' => $this->when(\config('torrent.magnet') === true, 'magnet:?dn='.$this->name.'&xt=urn:btih:'.$this->info_hash.'&as='.route('torrent.download.rsskey', ['id' => $this->id, 'rsskey' => \auth('api')->user()->rsskey]).'&tr='.route('announce', ['passkey' => \auth('api')->user()->passkey]).'&xl='.$this->size),
|
||||
'details_link' => \route('torrent', ['id' => $this->id]),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user