-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "% Selected" column to transfer list #22131
base: master
Are you sure you want to change the base?
Add "% Selected" column to transfer list #22131
Conversation
@@ -194,6 +194,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation | |||
case TR_INFOHASH_V2: return tr("Info Hash v2", "i.e: torrent info hash v2"); | |||
case TR_REANNOUNCE: return tr("Reannounce In", "Indicates the time until next trackers reannounce"); | |||
case TR_PRIVATE: return tr("Private", "Flags private torrents"); | |||
case TR_PERCENT_SELECTED: return tr("% Selected", "Percentage of torrent selected"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
% Selected
Don't know about others but for me, what comes to mind is percentage of files selected not percentage of size.
@@ -443,6 +444,8 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons | |||
return reannounceString(torrent->nextAnnounce()); | |||
case TR_PRIVATE: | |||
return privateString(torrent->isPrivate(), torrent->hasMetadata()); | |||
case TR_PERCENT_SELECTED: | |||
return QString::number((torrent->wantedSize() * 100) / torrent->totalSize()) + u'%'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should show "N/A" when torrent doesn't have metadata.
@@ -107,6 +107,12 @@ QVariantMap serialize(const BitTorrent::Torrent &torrent) | |||
: (QDateTime::currentSecsSinceEpoch() - timeSinceActivity); | |||
}; | |||
|
|||
const auto getSelectedPercentage = [&torrent]() -> QString | |||
{ | |||
auto percent = ((torrent.wantedSize() * 100)/torrent.totalSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto percent = ((torrent.wantedSize() * 100)/torrent.totalSize()); | |
auto percent = ((torrent.wantedSize() * 100) / torrent.totalSize()); |
Closes #22087.
Description
A new column that displays the % of selected data from a torrent.
Its meant to make it easier to distinguish and manage partial torrents as described in the issue.
UI images
Two partial picture of the UI follow, first is from Desktop app (Linux) second is from WebUI (Linux, Mozilla)
Example use case
You download a few episodes of series or files and want to determine by the first files if its worth downloading the whole torrent. In the presence of multiple torrents it might become bothersome to seek out those partial ones.
With this column you could go in
Completed
and order by% Selected
ascending, which would put the partial torrents on top. From there on its up to the user.