From bc193c71410930d1b2fee11b6b0d8ab9ebfb87af Mon Sep 17 00:00:00 2001 From: w33b Date: Mon, 22 Sep 2025 13:34:52 +0200 Subject: [PATCH] Remove torrents system --- .../Controllers/Admin/TorrentController.php | 40 ------------------- app/Models/Hentai.php | 5 --- app/Models/Torrents.php | 22 ---------- .../2025_09_22_113103_drop_torrents_table.php | 24 +++++++++++ resources/views/admin/add-torrent.blade.php | 32 --------------- .../partials/torrent-button.blade.php | 25 ------------ .../partials/download-authorized.blade.php | 2 - routes/web.php | 4 -- 8 files changed, 24 insertions(+), 130 deletions(-) delete mode 100644 app/Http/Controllers/Admin/TorrentController.php delete mode 100644 app/Models/Torrents.php create mode 100644 database/migrations/2025_09_22_113103_drop_torrents_table.php delete mode 100644 resources/views/admin/add-torrent.blade.php delete mode 100644 resources/views/livewire/partials/torrent-button.blade.php diff --git a/app/Http/Controllers/Admin/TorrentController.php b/app/Http/Controllers/Admin/TorrentController.php deleted file mode 100644 index 3806d94..0000000 --- a/app/Http/Controllers/Admin/TorrentController.php +++ /dev/null @@ -1,40 +0,0 @@ - $hentai_id - ]); - } - - /** - * Add Torrent. - */ - public function store(Request $request): \Illuminate\Http\RedirectResponse - { - $validated = $request->validate([ - 'hentai_id' => 'required|exists:hentais,id', - 'torrent_url' => 'required|string|max:256', - 'torrent_episodes' => 'required|string|max:8', - ]); - - Torrents::create([ - 'hentai_id' => $request->hentai_id, - 'torrent_url' => $request->torrent_url, - 'episodes' => $request->torrent_episodes, - ]); - - return to_route('download.search'); - } -} diff --git a/app/Models/Hentai.php b/app/Models/Hentai.php index e043383..f17bd6f 100644 --- a/app/Models/Hentai.php +++ b/app/Models/Hentai.php @@ -32,11 +32,6 @@ class Hentai extends Model implements Sitemapable return $this->hasMany(Episode::class, 'hentai_id'); } - public function torrents() - { - return $this->hasMany(Torrents::class, 'hentai_id'); - } - public function title(): String { return $this->episodes->first()->title; diff --git a/app/Models/Torrents.php b/app/Models/Torrents.php deleted file mode 100644 index e75af0f..0000000 --- a/app/Models/Torrents.php +++ /dev/null @@ -1,22 +0,0 @@ - -
-
-
-
- @csrf - -
- - -
- -
- - -
- -
- - -
- -
- -
-
-
-
-
- diff --git a/resources/views/livewire/partials/torrent-button.blade.php b/resources/views/livewire/partials/torrent-button.blade.php deleted file mode 100644 index 29cbe5e..0000000 --- a/resources/views/livewire/partials/torrent-button.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -@forelse ($hentai->torrents as $torrent) - - - -@empty - - - -@endforelse diff --git a/resources/views/modals/partials/download-authorized.blade.php b/resources/views/modals/partials/download-authorized.blade.php index b02cb26..83735d0 100644 --- a/resources/views/modals/partials/download-authorized.blade.php +++ b/resources/views/modals/partials/download-authorized.blade.php @@ -13,8 +13,6 @@ @foreach ($dlList as $hdl) @include('modals.partials.download-button') @endforeach - - @include('livewire.partials.torrent-button', ['hentai' => $episode->hentai]) @include('modals.partials.download-backup') diff --git a/routes/web.php b/routes/web.php index 186696e..52c768c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -123,10 +123,6 @@ Route::group(['middleware' => ['auth', 'auth.admin']], function () { Route::get('/admin/tags/{episode_id}', [AdminApiController::class, 'getEpisodeTags'])->name('admin.tags.episode'); Route::get('/admin/studio/{episode_id}', [AdminApiController::class, 'getEpisodeStudio'])->name('admin.studio.episode'); - // Torrents - Route::get('/admin/add-torrent/{hentai_id}', [App\Http\Controllers\Admin\TorrentController::class, 'index'])->name('admin.add.torrentpage'); - Route::post('/admin/add-torrent', [App\Http\Controllers\Admin\TorrentController::class, 'store'])->name('admin.add.torrent'); - // Subtitles Route::get('/admin/subtitles/{episode_id}', [AdminApiController::class, 'getSubtitles'])->name('admin.subtitles'); Route::post('/admin/add-new-subtitle', [App\Http\Controllers\Admin\SubtitleController::class, 'store'])->name('admin.add.new.subtitle');