mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 05:31:25 -07:00
Show info hash in log when added a duplicate torrent
Closes #22161. PR #22505.
This commit is contained in:
parent
f0b9a17566
commit
ff03eeab5b
8 changed files with 45 additions and 11 deletions
|
@ -2790,8 +2790,8 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
|
|||
if (!isMergeTrackersEnabled())
|
||||
{
|
||||
const QString message = tr("Merging of trackers is disabled");
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Existing torrent: %1. Result: %2")
|
||||
.arg(torrent->name(), message));
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Existing torrent: \"%1\". Torrent infohash: %2. Result: %3")
|
||||
.arg(torrent->name(), torrent->infoHash().toString(), message));
|
||||
emit addTorrentFailed(infoHash, {AddTorrentError::DuplicateTorrent, message});
|
||||
return false;
|
||||
}
|
||||
|
@ -2800,8 +2800,8 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
|
|||
if (isPrivate)
|
||||
{
|
||||
const QString message = tr("Trackers cannot be merged because it is a private torrent");
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Existing torrent: %1. Result: %2")
|
||||
.arg(torrent->name(), message));
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Existing torrent: \"%1\". Torrent infohash: %2. Result: %3")
|
||||
.arg(torrent->name(), torrent->infoHash().toString(), message));
|
||||
emit addTorrentFailed(infoHash, {AddTorrentError::DuplicateTorrent, message});
|
||||
return false;
|
||||
}
|
||||
|
@ -2811,8 +2811,8 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
|
|||
torrent->addUrlSeeds(source.urlSeeds());
|
||||
|
||||
const QString message = tr("Trackers are merged from new source");
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Existing torrent: %1. Result: %2")
|
||||
.arg(torrent->name(), message));
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Existing torrent: \"%1\". Torrent infohash: %2. Result: %3")
|
||||
.arg(torrent->name(), torrent->infoHash().toString(), message));
|
||||
emit addTorrentFailed(infoHash, {AddTorrentError::DuplicateTorrent, message});
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue