Commits

anothergene committed 5d3e526

added a check to make sure it didn't delete any files that weren't finished downloading even though the age had surpassed the limit.

  • Participants
  • Parent commits 4e3cbbf

Comments (0)

Files changed (1)

File transmission-removedone.py

 #!/usr/bin/env python2.7
-# encoding: utf-8
 
 import argparse
 import datetime
 import sys
+
 import transmissionrpc
 
 def main(argv=None):
     for t in tl:
         age = datetime.datetime.now() - tl[t].date_added
         
-        if (theargs.ratio > 0 and tl[t].ratio >= theargs.ratio) or (age.days >= theargs.days):
+        if ((theargs.ratio > 0 and tl[t].ratio >= theargs.ratio and tl[t].status != 'downloading') or 
+           (age.days >= theargs.days)):
             nothingprocessed = False
             print 'removing torrent ' + tl[t].name +' and data file.'
             tc.remove(t, True)