Skip to content

Commit

Permalink
Return first tracker as fallback for "current tracker"
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Jan 31, 2025
1 parent a018cfa commit ded600b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/base/bittorrent/torrentimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,16 @@ qlonglong TorrentImpl::wastedSize() const

QString TorrentImpl::currentTracker() const
{
return QString::fromStdString(m_nativeStatus.current_tracker);
if (const auto currentTracker = QString::fromStdString(m_nativeStatus.current_tracker);
!currentTracker.isEmpty())
{
return currentTracker;
}

if (trackers().size() > 0)
return trackers().value(0).url;

return {};
}

Path TorrentImpl::savePath() const
Expand Down

0 comments on commit ded600b

Please sign in to comment.