Opened 10 years ago

Closed 10 years ago

#4357 closed Bug (fixed)

Wrong torrent count on tracker filter-bar

Reported by: rb07 Owned by: jordan
Priority: Normal Milestone: 2.33
Component: Qt Client Version: 2.32
Severity: Minor Keywords:
Cc:

Description

One tracker I use added a couple of addresses as primary trackers, this causes T-Qt to loose count as torrents come and go.


Here's an example:

All torrents have the same tracker info. http://img818.imageshack.us/img818/1053/torrentpropertiestracke.png

The filter bar shows different counts for the different trackers (I added the icons for the other trackers manually), one count is always correct (there is no relation to the total number, I deleted one and the counts are 3, 7, 7 and All has 6).

http://img844.imageshack.us/img844/1053/torrentpropertiestracke.png

Change History (11)

comment:1 Changed 10 years ago by jordan

  • Milestone changed from None Set to 2.33
  • Status changed from new to assigned

comment:2 Changed 10 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

Seems to be working correctly now in r12547. Thanks for the report!

comment:3 Changed 10 years ago by rb07

  • Resolution fixed deleted
  • Status changed from closed to reopened

I just tested r12547, and instead of 3 trackers it shows one... but the count is the addition of all 3 (i.e. 9 instead of 3).

comment:4 Changed 10 years ago by rb07

The problem is that all 3 trackers have the same "readableHostName", the following change fixes the count and only one tracker is shown in the filter bar combo:

Index: filterbar.cc
===================================================================
--- filterbar.cc        (revision 12548)
+++ filterbar.cc        (working copy)
@@ -319,7 +319,7 @@
         }
         foreach( QString host, torrentHosts ) {
             newHosts.insert( host );
-            ++torrentsPerHost[ readableHostName( host ) ];
+            ++torrentsPerHost[ host ];
         }
     }
 
@@ -331,7 +331,7 @@
     {
         const QString name = readableHostName( host );
         QStandardItem * row = myTrackerModel->findItems(name).front();
-        row->setData( getCountString(torrentsPerHost[name]), TorrentCountRole );
+        row->setData( getCountString(torrentsPerHost[host]), TorrentCountRole );
         row->setData( favicons.findFromHost(host), Qt::DecorationRole );
     }

comment:5 Changed 10 years ago by jordan

You're right about the new bug, but that patch isn't quite right yet -- it handles the case where multi-domain tracker puts all the domains in the announce list, but not the case where it only puts one in the announce list. In that situation, some of the torrents won't be counted.

comment:6 Changed 10 years ago by jordan

rb07, r12549 the condition in comment:5 and ought to fix the issue you mentioned in comment:3. Could you give it a try to confirm?

comment:7 Changed 10 years ago by rb07

Something is wrong with r12549, all counts are zero, except "All" which is fine.

comment:8 Changed 10 years ago by jordan

Very strange, I'm not seeing that at all... :(

comment:9 Changed 10 years ago by rb07

My mistake, sorry, I still have a changed line in filterbar.cc; I'll rebuild and test again.

comment:10 Changed 10 years ago by rb07

All is fine with r12549.

Time to close this ticket.

comment:11 Changed 10 years ago by jordan

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.