Skip to content

Commit 1c9728c

Browse files
authored
Merge pull request #4630 from HDInnovations/development
(Release) UNIT3D v9.0.5
2 parents 598b837 + 3097949 commit 1c9728c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+136
-943
lines changed

app/Console/Commands/FetchMeta.php

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ final public function handle(): void
5858
->whereRelation('category', 'movie_meta', '=', true)
5959
->select('tmdb_movie_id')
6060
->distinct()
61+
->whereNotNull('tmdb_movie_id')
6162
->pluck('tmdb_movie_id');
6263

6364
$this->info('Queueing all tmdb movie metadata fetching');
@@ -74,6 +75,7 @@ final public function handle(): void
7475
->whereRelation('category', 'tv_meta', '=', true)
7576
->select('tmdb_tv_id')
7677
->distinct()
78+
->whereNotNull('tmdb_tv_id')
7779
->pluck('tmdb_tv_id');
7880

7981
$this->info('Queueing all tmdb tv metadata fetching');
@@ -90,6 +92,7 @@ final public function handle(): void
9092
->whereRelation('category', 'game_meta', '=', true)
9193
->select('igdb')
9294
->distinct()
95+
->whereNotNull('igdb')
9396
->pluck('igdb');
9497

9598
$this->info('Queueing all igdb game metadata fetching');

app/Http/Controllers/RequestController.php

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public function show(Request $request, TorrentRequest $torrentRequest): \Illumin
7171
'genres',
7272
'credits' => ['person', 'occupation'],
7373
'networks',
74-
'seasons'
7574
])
7675
->find($torrentRequest->tmdb_tv_id),
7776
($torrentRequest->category->movie_meta && $torrentRequest->tmdb_movie_id) => TmdbMovie::with([

app/Http/Controllers/SimilarTorrentController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public function show(int $categoryId, int $tmdbId): \Illuminate\Contracts\View\F
7676
'genres',
7777
'companies',
7878
'platforms',
79-
]);
79+
])
80+
->findOrFail($tmdbId);
8081

8182
$igdb = $tmdbId;
8283

app/Http/Controllers/StatsController.php

-11
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,6 @@ public function groups(): \Illuminate\Contracts\View\Factory|\Illuminate\View\Vi
261261
]);
262262
}
263263

264-
/**
265-
* Show Extra-Stats Groups.
266-
*/
267-
public function group(int $id): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
268-
{
269-
return view('stats.groups.group', [
270-
'group' => Group::findOrFail($id),
271-
'users' => User::with(['group'])->withTrashed()->where('group_id', '=', $id)->latest()->paginate(100),
272-
]);
273-
}
274-
275264
/**
276265
* Show Group Requirements.
277266
*/

app/Http/Controllers/User/PasskeyController.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@ protected function update(Request $request, User $user): \Illuminate\Http\Redire
5151

5252
cache()->forget('user:'.$user->passkey);
5353

54-
Unit3dAnnounce::removeUser($user);
54+
$newPasskey = md5(random_bytes(60).$user->password);
5555

56-
DB::transaction(static function () use ($user, $changedByStaff): void {
56+
Unit3dAnnounce::addUser($user, $newPasskey);
57+
58+
DB::transaction(static function () use ($user, $changedByStaff, $newPasskey): void {
5759
$user->passkeys()->latest()->first()?->update(['deleted_at' => now()]);
5860

5961
$user->update([
60-
'passkey' => md5(random_bytes(60).$user->password)
62+
'passkey' => $newPasskey,
6163
]);
6264

6365
$user->passkeys()->create(['content' => $user->passkey]);
6466

6567
if ($changedByStaff) {
6668
$user->notify(new PasskeyReset());
6769
}
68-
});
69-
70-
Unit3dAnnounce::addUser($user);
70+
}, 5);
7171

7272
return to_route('users.passkeys.index', ['user' => $user])
7373
->with('success', 'Your passkey was changed successfully.');

app/Http/Livewire/SimilarTorrent.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use Livewire\Attributes\Computed;
3838
use Livewire\Attributes\Url;
3939
use Livewire\Component;
40-
use MarcReichel\IGDBLaravel\Models\Game;
4140

4241
class SimilarTorrent extends Component
4342
{
@@ -46,7 +45,7 @@ class SimilarTorrent extends Component
4645

4746
public Category $category;
4847

49-
public TmdbMovie|TmdbTv|Game $work;
48+
public TmdbMovie|TmdbTv|IgdbGame $work;
5049

5150
public ?int $tmdbId;
5251

@@ -282,7 +281,7 @@ final public function torrents(): \Illuminate\Support\Collection
282281
)
283282
->when($this->category->tv_meta, fn ($query) => $query->where('tmdb_tv_id', '=', $this->tmdbId))
284283
->when($this->category->movie_meta, fn ($query) => $query->where('tmdb_movie_id', '=', $this->tmdbId))
285-
->when($this->category->game_meta, fn ($query) => $query->where('igdb', '=', $this->tmdbId))
284+
->when($this->category->game_meta, fn ($query) => $query->where('igdb', '=', $this->igdbId))
286285
->where((new TorrentSearchFiltersDTO(
287286
name: $this->name,
288287
description: $this->description,

app/Http/Livewire/TmdbTvSearch.php

-58
This file was deleted.

app/Jobs/ProcessMovieJob.php

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public function handle(): void
6262

6363
$movieScraper = new Client\Movie($this->id);
6464

65+
if ($movieScraper->getMovie() === null) {
66+
return;
67+
}
68+
6569
$movie = TmdbMovie::updateOrCreate(['id' => $this->id], $movieScraper->getMovie());
6670

6771
// Genres

app/Jobs/ProcessTvJob.php

+4-17
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818

1919
use App\Models\TmdbCompany;
2020
use App\Models\TmdbCredit;
21-
use App\Models\TmdbEpisode;
2221
use App\Models\TmdbGenre;
2322
use App\Models\TmdbNetwork;
2423
use App\Models\TmdbPerson;
2524
use App\Models\TmdbRecommendation;
26-
use App\Models\TmdbSeason;
2725
use App\Models\Torrent;
2826
use App\Models\TmdbTv;
2927
use App\Services\Tmdb\Client;
@@ -64,6 +62,10 @@ public function handle(): void
6462

6563
$tvScraper = new Client\TV($this->id);
6664

65+
if ($tvScraper->getTv() === null) {
66+
return;
67+
}
68+
6769
$tv = TmdbTv::updateOrCreate(['id' => $this->id], $tvScraper->getTv());
6870

6971
// Companies
@@ -106,21 +108,6 @@ public function handle(): void
106108
TmdbCredit::where('tmdb_tv_id', '=', $this->id)->delete();
107109
TmdbCredit::upsert($credits, ['tmdb_person_id', 'tmdb_movie_id', 'tmdb_tv_id', 'occupation_id', 'character']);
108110

109-
// Seasons and episodes
110-
111-
$seasons = [];
112-
$episodes = [];
113-
114-
foreach ($tvScraper->getSeasons() as $season) {
115-
$seasonScraper = new Client\Season($this->id, $season['season_number']);
116-
117-
$seasons[] = $seasonScraper->getSeason();
118-
array_push($episodes, ...$seasonScraper->getEpisodes());
119-
}
120-
121-
TmdbSeason::upsert($seasons, 'id');
122-
TmdbEpisode::upsert($episodes, 'id');
123-
124111
// Recommendations
125112

126113
TmdbRecommendation::upsert($tvScraper->getRecommendations(), ['recommended_tmdb_tv_id', 'tmdb_tv_id']);

app/Models/GuestStar.php

-59
This file was deleted.

app/Models/TmdbEpisode.php

-61
This file was deleted.

0 commit comments

Comments
 (0)