#3325: Cant remove torrents with 0 download size
------------------------+---------------------------
  Reporter:  granjerox  |      Owner:
      Type:  bug        |     Status:  new
  Priority:  major      |  Milestone:  2.0.4
 Component:  Core       |    Version:
Resolution:             |   Keywords:  remove delete
------------------------+---------------------------

Comment (by fast9881):

 From what i understand the probem is trying deluge is trying to delete a
 (magnet) torrent while it still hasn't downloaded or the .torrent is
 missing.
 In my case it breaks because i have the 'copy .torrent files to' and
 'delete copy of .torrents on remove' options active.

 I managed to at least patch it on my system (fedora 32 headless) by adding
 a simple size check like before it calls for the deletion function

 {{{
 #!diff
 Index: deluge/core/torrentmanager.py
 ===================================================================
 --- deluge/core/torrentmanager.py
 +++ deluge/core/torrentmanager.py
 @@ -741,7 +741,8 @@ def remove(self, torrent_id, remove_data=False,
 save_state=True): magnet=None):
         # Remove the .torrent file in the state and copy location, if user
 requested.
         delete_copies = (
             self.config['copy_torrent_file'] and
 self.config['del_copy_torrent_file']
         )
 +       if torrent.get_status(['num_pieces'])['num_pieces'] != 0:
             torrent.delete_torrentfile(delete_copies)
 }}}

 and it seems to work

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3325#comment:11>
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/063.2e977945d026486e8d0254a310081070%40deluge-torrent.org.

Reply via email to