Suggestion: Additionally highlight torrent names in no trackers achievable

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

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
Anthony Fieroni
Alexander Trufanov
Review request changed

Status: Discarded

Change Summary:

Will continue on phabricator