|
28 | 28 | use App\Models\Distributor;
|
29 | 29 | use App\Models\History;
|
30 | 30 | use App\Models\IgdbGame;
|
31 |
| -use App\Models\Keyword; |
32 | 31 | use App\Models\TmdbMovie;
|
33 | 32 | use App\Models\Region;
|
34 | 33 | use App\Models\Resolution;
|
@@ -194,7 +193,6 @@ public function edit(Request $request, int $id): \Illuminate\Contracts\View\Fact
|
194 | 193 | 'resolutions' => Resolution::orderBy('position')->get(),
|
195 | 194 | 'regions' => Region::orderBy('position')->get(),
|
196 | 195 | 'distributors' => Distributor::orderBy('name')->get(),
|
197 |
| - 'keywords' => Keyword::where('torrent_id', '=', $torrent->id)->pluck('name'), |
198 | 196 | 'torrent' => $torrent,
|
199 | 197 | 'user' => $user,
|
200 | 198 | ]);
|
@@ -245,21 +243,6 @@ public function update(UpdateTorrentRequest $request, int $id): \Illuminate\Http
|
245 | 243 | Image::make($image_cover->getRealPath())->fit(960, 540)->encode('jpg', 90)->save($path_cover);
|
246 | 244 | }
|
247 | 245 |
|
248 |
| - // Torrent Keywords System |
249 |
| - Keyword::where('torrent_id', '=', $torrent->id)->delete(); |
250 |
| - |
251 |
| - $keywords = []; |
252 |
| - |
253 |
| - foreach (TorrentTools::parseKeywords($request->string('keywords')) as $keyword) { |
254 |
| - $keywords[] = ['torrent_id' => $torrent->id, 'name' => $keyword]; |
255 |
| - } |
256 |
| - |
257 |
| - foreach (collect($keywords)->chunk(65_000 / 2) as $keywords) { |
258 |
| - Keyword::upsert($keywords->toArray(), ['torrent_id', 'name']); |
259 |
| - } |
260 |
| - |
261 |
| - $category = $torrent->category; |
262 |
| - |
263 | 246 | // Meta
|
264 | 247 |
|
265 | 248 | match (true) {
|
@@ -458,17 +441,6 @@ public function store(StoreTorrentRequest $request): \Illuminate\Http\RedirectRe
|
458 | 441 | default => null,
|
459 | 442 | };
|
460 | 443 |
|
461 |
| - // Torrent Keywords System |
462 |
| - $keywords = []; |
463 |
| - |
464 |
| - foreach (TorrentTools::parseKeywords($request->string('keywords')) as $keyword) { |
465 |
| - $keywords[] = ['torrent_id' => $torrent->id, 'name' => $keyword]; |
466 |
| - } |
467 |
| - |
468 |
| - foreach (collect($keywords)->chunk(intdiv(65_000, 2)) as $keywords) { |
469 |
| - Keyword::upsert($keywords->toArray(), ['torrent_id', 'name']); |
470 |
| - } |
471 |
| - |
472 | 444 | // check for trusted user and update torrent
|
473 | 445 | if ($user->group->is_trusted && !$request->boolean('mod_queue_opt_in')) {
|
474 | 446 | $appurl = config('app.url');
|
|
0 commit comments