Lately I have been working on Views integration. After looking at what was required to integrate with View I decided that re-writing some of the code for the tracker would increase performance all around. A few of the fields I wanted to make available included seeders, leechers, and snatches. Seeders and leechers are returned in scrape requests and snatches was a new feature, so I set about integrating. For the scrape request of seeders and leechers I was using COUNT() in my queries, to use this in Views I would need to write handlers and figure all of that out. Instead I added the fields onto the bt_torrents table and I am having the tracker manipulate these based on events. After making these changes scrape.php was overhauled to use the new fields and as a result it now has 1 query per information hash, which is a decent improvement over the previous three. Also while thinking about it the new structure allows for expansion of the bt_torrent module. I am thinking of a use-case where a site would like to host torrents, but not track them. It would be nice to display the statistics associated with the torrent even if it is not being tracked. This new structure would allow those statistics to be stored locally being updated at a set interval (this part has not been implemented). I will keep working on views and then move on to web seeding next.
