mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-26 21:37:22 +08:00
fix takeupload duplicate tagId
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.10');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.10');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-10-17');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-10-28');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -6006,7 +6006,9 @@ function insert_torrent_tags($torrentId, $tagIdArr, $sync = false)
|
|||||||
do_log("special tag: $tagId, and user no permission");
|
do_log("special tag: $tagId, and user no permission");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$values[] = sprintf("(%s, %s, '%s', '%s')", $torrentId, $tagId, $dateTimeStringNow, $dateTimeStringNow);
|
if (!isset($values[$tagId])) {
|
||||||
|
$values[$tagId] = sprintf("(%s, %s, '%s', '%s')", $torrentId, $tagId, $dateTimeStringNow, $dateTimeStringNow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$insertTagsSql .= implode(', ', $values);
|
$insertTagsSql .= implode(', ', $values);
|
||||||
do_log("[INSERT_TAGS], torrent: $torrentId with tags: " . nexus_json_encode($tagIdArr));
|
do_log("[INSERT_TAGS], torrent: $torrentId with tags: " . nexus_json_encode($tagIdArr));
|
||||||
|
|||||||
@@ -724,7 +724,10 @@ function get_tracker_schema_and_host($trackerUrlId, $combine = false): array|str
|
|||||||
$url = \App\Models\TrackerUrl::getById($trackerUrlId);
|
$url = \App\Models\TrackerUrl::getById($trackerUrlId);
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
$ssl_torrent = isHttps() ? 'https://' : 'http://';
|
$ssl_torrent = isHttps() ? 'https://' : 'http://';
|
||||||
$base_announce_url = sprintf("%s/%s", \App\Models\Setting::getBaseUrl(), DEFAULT_TRACKER_URI);
|
$base_announce_url = sprintf(
|
||||||
|
"%s/%s",
|
||||||
|
trim(\App\Models\Setting::getBaseUrl(), '/'), trim(DEFAULT_TRACKER_URI, '/')
|
||||||
|
);
|
||||||
$log .= ", ById no value";
|
$log .= ", ById no value";
|
||||||
} else {
|
} else {
|
||||||
$ssl_torrent = parse_url($url, PHP_URL_SCHEME) . "://" ;
|
$ssl_torrent = parse_url($url, PHP_URL_SCHEME) . "://" ;
|
||||||
|
|||||||
+1
-4
@@ -135,10 +135,7 @@ $isDonor = is_donor($az);
|
|||||||
$az['__is_donor'] = $isDonor;
|
$az['__is_donor'] = $isDonor;
|
||||||
$log = "user: $userid, isDonor: $isDonor, seeder: $seeder, ip: $ip, ipv4: $ipv4, ipv6: $ipv6";
|
$log = "user: $userid, isDonor: $isDonor, seeder: $seeder, ip: $ip, ipv4: $ipv4, ipv6: $ipv6";
|
||||||
//check tracker url
|
//check tracker url
|
||||||
$trackerUrl = \App\Models\TrackerUrl::getById($az['tracker_url_id']);
|
$trackerUrl = get_tracker_schema_and_host($az['tracker_url_id'], true);
|
||||||
if ($trackerUrl === false) {
|
|
||||||
warn("please select tracker url at user control panel");
|
|
||||||
}
|
|
||||||
$currentUrl = getSchemeAndHttpHost();
|
$currentUrl = getSchemeAndHttpHost();
|
||||||
if (!str_contains($trackerUrl, $currentUrl)) {
|
if (!str_contains($trackerUrl, $currentUrl)) {
|
||||||
do_log("announce check tracker url, trackerUrl: $trackerUrl does not contains: $currentUrl");
|
do_log("announce check tracker url, trackerUrl: $trackerUrl does not contains: $currentUrl");
|
||||||
|
|||||||
Reference in New Issue
Block a user