def set_filepieceranges(self, metainfo):
        selected_files = self.dlconfig['selected_files'][:]
        filelist = self.get_def().get_files()
        for fi in self.dlconfig['extra_files']:
            selected_files.append(filelist[fi])

        length, self.filepieceranges = maketorrent.get_length_filepieceranges_from_metainfo(metainfo, selected_files)
        if DEBUG:
            log(self.log_prefix + 'set_filepieceranges: self.selected_files', self.dlconfig['selected_files'], 'selected_files', selected_files, 'self.filepieceranges', self.filepieceranges)
Esempio n. 2
0
 def get_length(self, selectedfiles=None):
     if not self.metainfo_valid:
         raise NotYetImplementedException()
     length, filepieceranges = maketorrent.get_length_filepieceranges_from_metainfo(
         self.metainfo, selectedfiles)
     return length
Esempio n. 3
0
 def get_length(self, selectedfiles = None):
     if not self.metainfo_valid:
         raise NotYetImplementedException()
     length, filepieceranges = maketorrent.get_length_filepieceranges_from_metainfo(self.metainfo, selectedfiles)
     return length