From 86387fbe49af0d3bd596678f5d280cab75e5f61e Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Sat, 1 Feb 2025 14:58:12 +0300 Subject: [PATCH] Return first tracker as fallback for "current tracker" PR #22224. Closes #20415. --- src/base/bittorrent/torrentimpl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index fc6f70f77..af1afc498 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -463,7 +463,13 @@ qlonglong TorrentImpl::wastedSize() const QString TorrentImpl::currentTracker() const { - return QString::fromStdString(m_nativeStatus.current_tracker); + if (!m_nativeStatus.current_tracker.empty()) + return QString::fromStdString(m_nativeStatus.current_tracker); + + if (!m_trackerEntryStatuses.isEmpty()) + return m_trackerEntryStatuses.constFirst().url; + + return {}; } Path TorrentImpl::savePath() const