def checkTorrentFinished():
 logger.info('Checking if any torrents have finished seeding and can be removed')
 with postprocessor_lock:
  myDB = db.DBConnection()
  results = myDB.select('SELECT * from snatched WHERE Status="Seed_Processed"')
  for album in results:
   hash = album['FolderName']
   albumid = album['AlbumID']
   torrent_removed = False
   if (headphones.CONFIG.TORRENT_DOWNLOADER == 1):
    torrent_removed = transmission.removeTorrent(hash, True)
   else:
    torrent_removed = utorrent.removeTorrent(hash, True)
   if torrent_removed:
    myDB.action('DELETE from snatched WHERE status = "Seed_Processed" and AlbumID=?', [albumid])
 logger.info('Checking finished torrents completed')

def checkTorrentFinished ( ) : logger . info ( 'Checking if any torrents have finished seeding and can be removed' ) with postprocessor_lock : myDB = db . DBConnection ( ) results = myDB . select ( 'SELECT * from snatched WHERE Status="Seed_Processed"' ) for album in results : hash = album [ 'FolderName' ] albumid = album [ 'AlbumID' ] torrent_removed = False if ( headphones . CONFIG . TORRENT_DOWNLOADER == 1 ) : torrent_removed = transmission . removeTorrent ( hash , True ) else : torrent_removed = utorrent . removeTorrent ( hash , True ) if torrent_removed : myDB . action ( 'DELETE from snatched WHERE status = "Seed_Processed" and AlbumID=?' , [ albumid ] ) logger . info ( 'Checking finished torrents completed' )
remove torrent + data if post processed and finished seeding .