BitTorrent Module Weekly Update 2

What have I done this week?? A lot of awesome work! Earlier this week I was working on announce.php trying to figure out settings and keys that the tracker would need. That was fine until I talked to flk (shakur?) and we discussed my progress and what I was working on. He suggested that I stop work on the tracker and generate a data model for my module. Then work on how this model would interact with the module, and finally writing the core of the module. I took his advice and created the database structure first. After a few revisions and input from my mentor(chx) I had a solid data model. While developing this model I figured out how to store the torrents and the process to add a torrent, along with an added feature. We decided to modularize my module, first I will be creating a torrent node type. With this module a user may enter a title and description for their torrent and upload a .torrent file. The module then stores the entire torrent in the database (most torrents are under 100K) as well as plain text data that is pulled from the torrent such as announce url, files, info_hash. this way when constructing a view of the node the metadata does not need to be parsed, and when a user requests a torrent file for download the metadata can be retrieved without having to encode the plain text data that is in the database. After the node type is complete I will be working on the tracker portion. Since the announce url is stored in the database someone who wants to use this module has two options. They can enforce a rule stating that all uploaded torrents must be tracked by their drupal installation OR they may allow the user to choose whether to use the original tracker which is stored in the torrent file or to adjust the torrent file and use the tracker I am creating. I really like the direction this project is going.

As far as node type progression goes I am happy to report I have successfully created an info hash for a torrent file uploaded through my new content type. This is a big step as I am a little rusty with my php file handling skills. A big thanks goes to drewish for helping me with my hook_insert and hook_nodeapi questions. For anyone interested http://www.soc.deviantsolutions.net/test.php shows the two info hashes for my test torrent file. The top hash is the one that is being generated through php while the bottom is copied out of Azureus running the same torrent.

I have attached the database scheme. Feel free to comment with any thoughts and ideas.