Suggestion: Additionally highlight torrent names in no trackers achievable

Review Request #130032 - Created March 19, 2017 and updated

Alexander Trufanov


There are a few features that I personally lack a lot in KTorrent. One of them is torrent name highlighting in case its trackers aren't achievable. Usecase is following:

I'm seeding a lot and sometimes download torrents just to helpother seeders. And some torrents change often. Because author forgot something or made a mistake or just becouse some new content was added (for ex., new show episode is released).
Thus at some point you may realize that your torrent has 0 upload traffic and then you look into its trackers status and see "Torrent isn't found on server" or "not registered" or something like that. The sad thing is that you're not only not notified about new changes but also not seeding till you realize that.

That's why I made my torrent names highlight in darkRed if noTrackersReachable() == true. When I check the result I found out that it may be a bit better. Bcs I have 200 torrents running at once some of them from time to time get TimeOut errors from server. And most probably you ned to just wait to bypass this. It's usefull to know that some torrents faced with timeout issue but not when they are colored in screaming red. I want them yellow. So I've made a new function based on noTrackersReachable() that returns true if color need to be changed and darkRed/darkYellow colors. The rules are:

  • No trackers or all trackers disabled - do nothing
  • At least one tracker is reachable (has no error state) - do nothing
  • All nabled trackers has errors - color torrent name darkRed, but if there is at least one that has Timeout error - color in darkYellow.

And the result is: result is

The only problem with such approach is that there is no fancy way to detect the type of error. You must compare error message text which is localized. I found two tieout related error messages that observed in KTorrent:
1. "Timeout contacting tracker %1" from libktorrent.
2. "Timeout on server\n%1" from kio4

And the last one makes not feasible any attempt to modify libktorrent API to distinguish error types based on something apart error text.

As these massages are localized the "Yellow timeouts" part of suggested feature currently works for English locale only. I've surrounded messages with i10n() and added a context for translators pointing that these lines of translation should be in fact copied from existing .po files of other projects. So I hope soon they could be localized and "yellowish" become supported for other locales. And of course, "color with red" works for any locale.

I can make this optional by adding a checkbox to settings somewhere if needed. And even disabled by default if needed. And of course refactor if this suggestion will be found feasible to commit.

Alexander Trufanov
Review request changed

Change Summary:

small bugfix for private torrents


Revision 2 (+70)

Show changes

Anthony Fieroni

So, why not just add new enum values and check against them, comparing translated strings is unacceptable.

  1. I have 2 conserns.
    1. I don't know who else uses libktorrent apart from KTorrent itself. This is lib API change that might be a bad surprize for them.
    2. Second - is when I realize that "Timeout on server\n%1" message is originated from KIO I decide that ktorrent receives it as a generic error string in its turn too. So it need to compare srtings in lib or make KIO communicate this properly whih affects KIO API. Too many changes for a simple featuere doesn't feels feasible. It was my guess and I didn't thought on this much.

  2. On a second thought it seems feasible. KIO's KJob class provides error codes to libktorrent's Tracker but tracker class doesn't stores them. So I need only klibtorrent change to keep and pass them throw TrackerInterface to KTorrent. I'll try to do that in a separate review. But I doubt it may be done without breaking binary compatibility.