Changeset ecca2c4701e61d4f6a446eebd0be53e7a17415a8

Show
Ignore:
Timestamp:
02/04/2008 08:52:03 PM (1 year ago)
Author:
Andrew Yates <andrew@andrewyates.net>
git-committer:
Andrew Yates <andrew@andrewyates.net> 1202187123 -0600
git-parent:

[e099e7a43b16871e127d727d9074a34f6ba1120c]

git-author:
Andrew Yates <andrew@andrewyates.net> 1202187123 -0600
Message:

fixed torrent size bug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • torrent.py

    re099e7a recca2c4  
    3737                self.name = self.dict['info']['name'] 
    3838 
    39                 self.size = sum(int(tfile['length']) for tfile in self.dict['info']['files']) 
     39                if self.dict['info'].has_key('files'): 
     40                        self.size = sum(int(tfile['length']) for tfile in self.dict['info']['files']) 
     41                elif self.dict['info'].has_key('length'): 
     42                        self.size = self.dict['info']['length']; 
     43                else: 
     44                        print 'btoverlord: error: could not determine size for ' + self.name + ' stored in: ' + self.path + '. Please report this bug as the torrent has an unanticipated form.' 
     45                        self.size = 999999 
    4046 
    4147                self.chunk_len = self.dict['info']['piece length']