Update qbittorrent_worker.py

pull/5/head
midoks 5 years ago
parent 6924adbda3
commit 1d6fa13a94
  1. 9
      plugins/qbittorrent/workers/qbittorrent_worker.py

@ -140,9 +140,12 @@ class downloadBT(Thread):
return True
except Exception as e:
self.__db_err = e
sys.exit('未连接数据库!')
return False
def __check(self):
if not __db_err:
sys.exit('未连接数据库!')
def __close(self):
self.dbcurr.close()
self.dbconn.close()
@ -619,7 +622,7 @@ class downloadBT(Thread):
def check_task(self):
while True:
self.__conn()
self.__check()
torrents = self.qb.torrents(filter='downloading')
tlen = len(torrents)
if tlen > 0:
@ -642,7 +645,7 @@ class downloadBT(Thread):
def completed(self):
while True:
self.__conn()
self.__check()
torrents = self.qb.torrents(filter='completed')
if not torrents:
continue

Loading…
Cancel
Save