Skip to content

Commit

Permalink
Merge pull request #2179 from HDInnovations/6.x.x
Browse files Browse the repository at this point in the history
(Release) 6.0.6
  • Loading branch information
HDVinnie authored Apr 1, 2022
2 parents 5f8553f + 50dbebb commit 8730968
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 91 deletions.
3 changes: 2 additions & 1 deletion app/Console/Commands/GitUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,10 @@ private function compile(): void
$this->header('Compiling Assets ...');

$this->commands([
'npm install npm -g',
'rm -rf node_modules',
'npm cache clean --force',
'npm install',
'npm install --no-audit',
'npx mix -p',
]);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/AnnounceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function index(Request $request, string $passkey): ?\Illuminate\Http\Resp
/**
* Check Download Slots.
*/
if (\config('announce.slots_system.enabled')) {
if (\config('announce.slots_system.enabled') == true) {
$this->checkDownloadSlots($user);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/StatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function downloaded(): \Illuminate\Contracts\View\Factory|\Illuminate\Vie
public function seeders(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
// Fetch Top Seeders
$seeders = Peer::with('user')->select(DB::raw('user_id, count(*) as value'))->where('seeder', '=', 1)->groupBy('user_id')->latest('value')->take(100)->get();
$seeders = Peer::with('user')->select(DB::raw('user_id, count(distinct torrent_id) as value'))->where('seeder', '=', 1)->groupBy('user_id')->latest('value')->take(100)->get();

return \view('stats.users.seeders', ['seeders' => $seeders]);
}
Expand Down
63 changes: 37 additions & 26 deletions app/Http/Resources/TorrentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,52 @@ public function toArray($request): array
$meta = null;

if ($this->category->tv_meta && ($this->tmdb !== 0)) {
$meta = Tv::with('genres')->where('id', '=', $this->tmdb)->first();
$meta = Tv::where('id', '=', $this->tmdb)->first();
}

if ($this->category->movie_meta && ($this->tmdb !== 0)) {
$meta = Movie::with('genres')->where('id', '=', $this->tmdb)->first();
$meta = Movie::where('id', '=', $this->tmdb)->first();
}

return [
'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->resolution->name ?? '',
'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,
'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]),
'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]),
],
];
}
Expand Down
93 changes: 45 additions & 48 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8730968

Please sign in to comment.