Merge pull request #4513 from Roardom/fix-storage

(Fix) Torrent files storage disk
This commit is contained in:
HDVinnie
2025-03-04 21:42:38 -05:00
committed by GitHub
2 changed files with 5 additions and 5 deletions
@@ -135,7 +135,7 @@ class TorrentController extends BaseController
}
$fileName = \sprintf('%s.torrent', uniqid('', true)); // Generate a unique name
Storage::disk('torrents')->put($fileName, Bencode::bencode($decodedTorrent));
Storage::disk('torrent-files')->put($fileName, Bencode::bencode($decodedTorrent));
// Find the right category
$category = Category::withCount('torrents')->findOrFail($request->integer('category_id'));
@@ -315,8 +315,8 @@ class TorrentController extends BaseController
]);
if ($v->fails()) {
if (Storage::disk('torrents')->exists($fileName)) {
Storage::disk('torrents')->delete($fileName);
if (Storage::disk('torrent-files')->exists($fileName)) {
Storage::disk('torrent-files')->delete($fileName);
}
return $this->sendError('Validation Error.', $v->errors());
@@ -69,7 +69,7 @@ class TorrentDownloadController extends Controller
}
// The torrent file exist ?
if (!Storage::disk('torrents')->exists($torrent->file_name)) {
if (!Storage::disk('torrent-files')->exists($torrent->file_name)) {
return to_route('torrents.show', ['id' => $torrent->id])
->withErrors('Torrent File Not Found! Please Report This Torrent!');
}
@@ -86,7 +86,7 @@ class TorrentDownloadController extends Controller
return response()->streamDownload(
function () use ($id, $user, $torrent): void {
$dict = Bencode::bdecode(Storage::disk('torrents')->get($torrent->file_name));
$dict = Bencode::bdecode(Storage::disk('torrent-files')->get($torrent->file_name));
// Set the announce key and add the user passkey
$dict['announce'] = route('announce', ['passkey' => $user->passkey]);