diff --git a/include/constants.php b/include/constants.php index a5e86bdd..b8c9a1d6 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ '确定要认领此种子吗?', 'action_approval' => '审核', 'row_tags' => '标签', + 'torrent_existed' => '该种子已存在!' ); ?> diff --git a/lang/cht/lang_details.php b/lang/cht/lang_details.php index 94de3149..5dfcca75 100644 --- a/lang/cht/lang_details.php +++ b/lang/cht/lang_details.php @@ -241,6 +241,7 @@ $lang_details = array 'claim_confirm' => '確定要認領此種子嗎?', 'action_approval' => '審核', 'row_tags' => '標簽', + 'torrent_existed' => '該種子已存在!', ); ?> diff --git a/lang/en/lang_details.php b/lang/en/lang_details.php index 3e76b294..904ccabc 100644 --- a/lang/en/lang_details.php +++ b/lang/en/lang_details.php @@ -241,6 +241,7 @@ $lang_details = array 'claim_confirm' => 'Are you sure to claim this torrent?', 'action_approval' => 'Approval', 'row_tags' => 'Tags', + 'torrent_existed' => 'Torrent already uploaded!', ); ?> diff --git a/public/details.php b/public/details.php index 6602f3fb..92113599 100644 --- a/public/details.php +++ b/public/details.php @@ -68,7 +68,11 @@ if (!$row) { print("

".$lang_details['text_successfully_edited']."

"); if (isset($_GET["returnto"])) print("

".$lang_details['text_go_back'] . "" . $lang_details['text_whence_you_came']."

"); - } + } elseif (!empty($_GET['existed'])) { + print("

".$lang_details['torrent_existed']."

"); + if (isset($_GET["returnto"])) + print("

".$lang_details['text_go_back'] . "" . $lang_details['text_whence_you_came']."

"); + } $banned_torrent = ($row["banned"] == 'yes' ? " (".$lang_functions['text_banned'].")" : ""); $sp_torrent = get_torrent_promotion_append($row['sp_state'],'word', false, '', 0, '', $row['__ignore_global_sp_state'] ?? false); $sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false); diff --git a/public/takeupload.php b/public/takeupload.php index a9fce26d..af0954fd 100644 --- a/public/takeupload.php +++ b/public/takeupload.php @@ -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 ------------------//