fix takeupload duplicate tagId

This commit is contained in:
xiaomlove
2025-10-28 11:01:58 +07:00
parent 39f85fd001
commit 61f4de8868
4 changed files with 9 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
<?php
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('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -6006,7 +6006,9 @@ function insert_torrent_tags($torrentId, $tagIdArr, $sync = false)
do_log("special tag: $tagId, and user no permission");
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);
do_log("[INSERT_TAGS], torrent: $torrentId with tags: " . nexus_json_encode($tagIdArr));

View File

@@ -724,7 +724,10 @@ function get_tracker_schema_and_host($trackerUrlId, $combine = false): array|str
$url = \App\Models\TrackerUrl::getById($trackerUrlId);
if (empty($url)) {
$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";
} else {
$ssl_torrent = parse_url($url, PHP_URL_SCHEME) . "://" ;