upload when exists redirect to details page

This commit is contained in:
xiaomlove
2024-07-03 04:26:56 +08:00
parent 285e1061ce
commit 36fef3e834
6 changed files with 13 additions and 5 deletions
+4 -3
View File
@@ -179,9 +179,10 @@ unset ($dict['announce-list']); // remove multi-tracker capability
unset ($dict['nodes']); // remove cached peers (Bitcomet & Azareus)
$infohash = pack("H*", sha1(\Rhilip\Bencode\Bencode::encode($dict['info']))); // double up on the becoding solves the occassional misgenerated infohash
if (\App\Models\Torrent::query()->where('info_hash', $infohash)->exists()) {
bark($lang_takeupload['std_torrent_existed']);
$exists = \App\Models\Torrent::query()->where('info_hash', $infohash)->first(['id']);
if ($exists) {
// bark($lang_takeupload['std_torrent_existed']);
nexus_redirect(sprintf("details.php?id=%d&existed=1", $exists['id']));
}
// ------------- start: check upload authority ------------------//