From 4578561823224db137109de8375d65d56a72520a Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Fri, 31 Jan 2025 15:40:44 +0300 Subject: [PATCH] Return first tracker as fallback for "current tracker" 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