Skip to content

Commit

Permalink
Return first tracker as fallback for "current tracker"
Browse files Browse the repository at this point in the history
Closes #20415.
  • Loading branch information
glassez committed Jan 31, 2025
1 parent a018cfa commit 4578561
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/base/bittorrent/torrentimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4578561

Please sign in to comment.