Skip to content

Commit

Permalink
Change meaning of "seeders" and "leechers" columns (#245)
Browse files Browse the repository at this point in the history
"Seeders" and "leechers" now refer to total number of seeders and leechers reported by trackers,
while number of peers that we are currently downloading from / uploading to is displayed in separate columns.
  • Loading branch information
equeim committed Feb 4, 2023
1 parent 46daab6 commit fded441
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libtremotesf
12 changes: 10 additions & 2 deletions src/tremotesf/ui/screens/mainwindow/torrentsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ namespace tremotesf {
case Column::QueuePosition:
return torrent->data().queuePosition;
case Column::Seeders:
return torrent->data().activeSeedersCount;
return torrent->data().totalSeedersFromTrackersCount;
case Column::Leechers:
return torrent->data().activeLeechersCount;
return torrent->data().totalLeechersFromTrackersCount;
case Column::PeersSendingToUs:
return torrent->data().peersSendingToUsCount;
case Column::PeersGettingFromUs:
return torrent->data().peersGettingFromUsCount;
case Column::DownloadSpeed:
return Utils::formatByteSpeed(torrent->data().downloadSpeed);
case Column::UploadSpeed:
Expand Down Expand Up @@ -260,6 +264,10 @@ namespace tremotesf {
return qApp->translate("tremotesf", "Seeders");
case Column::Leechers:
return qApp->translate("tremotesf", "Leechers");
case Column::PeersSendingToUs:
return qApp->translate("tremotesf", "Downloading to peers");
case Column::PeersGettingFromUs:
return qApp->translate("tremotesf", "Uploading to peers");
case Column::DownloadSpeed:
return qApp->translate("tremotesf", "Down Speed");
case Column::UploadSpeed:
Expand Down
2 changes: 2 additions & 0 deletions src/tremotesf/ui/screens/mainwindow/torrentsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ namespace tremotesf {
QueuePosition,
Seeders,
Leechers,
PeersSendingToUs,
PeersGettingFromUs,
DownloadSpeed,
UploadSpeed,
Eta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,23 @@ namespace tremotesf {
activityGroupBoxLayout->addRow(qApp->translate("tremotesf", "ETA:"), etaLabel);
auto seedersLabel = new QLabel(this);
activityGroupBoxLayout->addRow(qApp->translate("tremotesf", "Seeders:"), seedersLabel);
auto activeWebSeedersLabel = new QLabel(this);
activityGroupBoxLayout->addRow(qApp->translate("tremotesf", "Active web seeders:"), activeWebSeedersLabel);
auto leechersLabel = new QLabel(this);
activityGroupBoxLayout->addRow(qApp->translate("tremotesf", "Leechers:"), leechersLabel);
auto peersSendingToUsLabel = new QLabel(this);
activityGroupBoxLayout->addRow(
qApp->translate("tremotesf", "Peers we are downloading from:"),
peersSendingToUsLabel
);
auto webSeedersSendingToUsLabel = new QLabel(this);
activityGroupBoxLayout->addRow(
qApp->translate("tremotesf", "Web seeders we are downloading from:"),
webSeedersSendingToUsLabel
);
auto peersGettingFromUsLabel = new QLabel(this);
activityGroupBoxLayout->addRow(
qApp->translate("tremotesf", "Peers we are uploading to:"),
peersGettingFromUsLabel
);
auto lastActivityLabel = new QLabel(this);
activityGroupBoxLayout->addRow(qApp->translate("tremotesf", "Last activity:"), lastActivityLabel);
detailsTabLayout->addWidget(activityGroupBox);
Expand Down Expand Up @@ -184,10 +197,12 @@ namespace tremotesf {
uploadSpeedLabel->setText(Utils::formatByteSpeed(mTorrent->data().uploadSpeed));
etaLabel->setText(Utils::formatEta(mTorrent->data().eta));

const QLocale locale;
seedersLabel->setText(locale.toString(mTorrent->data().activeSeedersCount));
activeWebSeedersLabel->setText(locale.toString(mTorrent->data().activeWebSeedersCount));
leechersLabel->setText(locale.toString(mTorrent->data().activeLeechersCount));
const QLocale locale{};
seedersLabel->setText(locale.toString(mTorrent->data().totalSeedersFromTrackersCount));
leechersLabel->setText(locale.toString(mTorrent->data().totalLeechersFromTrackersCount));
peersSendingToUsLabel->setText(locale.toString(mTorrent->data().peersSendingToUsCount));
webSeedersSendingToUsLabel->setText(locale.toString(mTorrent->data().webSeedersSendingToUsCount));
peersGettingFromUsLabel->setText(locale.toString(mTorrent->data().peersGettingFromUsCount));

lastActivityLabel->setText(mTorrent->data().activityDate.toLocalTime().toString());

Expand Down

0 comments on commit fded441

Please sign in to comment.