#3531: Deluge cannot load some torrents created by qBittorrent
----------------------------+---------------------
 Reporter:  Hello1024       |       Type:  patch
   Status:  new             |   Priority:  minor
Milestone:  needs verified  |  Component:  Unknown
  Version:  2.0.5           |   Keywords:
----------------------------+---------------------
 qBittorrent adds padding between files so that every file starts on a
 block boundary.

 If multiple files are the same size, then many of the padding files are
 also the same size.  If two padding files are of the same size, they also
 have the same name.  Deluge fails to add such files (the add torrent
 dialog shows the contents of the torrent, but upon clicking 'Add' an
 exception is raised).


 Example file:  https://github.com/yandex/YaLM-
 100B/blob/7e1fb5f436a499262fc14f6c83b2bb701e849b9f/yalm100b_checkpoint.torrent

 Traceback:


 {{{
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-
 packages/deluge/ui/gtk3/addtorrentdialog.py", line 740, in
 on_button_file_clicked
     self.add_from_files(result)
   File "/usr/lib/python3/dist-
 packages/deluge/ui/gtk3/addtorrentdialog.py", line 256, in add_from_files
     if not self._add_torrent_liststore(
   File "/usr/lib/python3/dist-
 packages/deluge/ui/gtk3/addtorrentdialog.py", line 224, in
 _add_torrent_liststore
     self.save_torrent_options(row_iter)
   File "/usr/lib/python3/dist-
 packages/deluge/ui/gtk3/addtorrentdialog.py", line 579, in
 save_torrent_options
     file_dict['download'] = files_priorities[i]
 KeyError: 13
 }}}


 I think in this case the fix is easy...

 Modify the code in addtorrentdialog.py around line 579 to say:


 {{{
         if len(files_priorities) > 0:
             for i, file_dict in enumerate(self.files[torrent_id]):
                 if i in files_priorities:
                     file_dict['download'] = files_priorities[i]
                 else:
                     # Happens in the case of duplicate filenames.
                     file_dict['download'] = False

 }}}


 I have tested this, and it loads the torrent and things seem to work.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3531>
Deluge <https://deluge-torrent.org/>
Deluge Project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/deluge-dev/048.d893073fc1bffd7a7ea4b9410dcaa4fd%40deluge-torrent.org.

Reply via email to