mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Refactor download_info db connection to module variable
This commit is contained in:
parent
04942bf6ad
commit
542893b30b
1 changed files with 2 additions and 2 deletions
|
@ -4,11 +4,12 @@ from six import text_type
|
|||
|
||||
from core import logger, main_db
|
||||
|
||||
my_db = main_db.DBConnection()
|
||||
|
||||
|
||||
def update_download_info_status(input_name, status):
|
||||
logger.db('Updating status of our download {0} in the DB to {1}'.format(input_name, status))
|
||||
|
||||
my_db = main_db.DBConnection()
|
||||
my_db.action('UPDATE downloads SET status=?, last_update=? WHERE input_name=?',
|
||||
[status, datetime.date.today().toordinal(), text_type(input_name)])
|
||||
|
||||
|
@ -16,7 +17,6 @@ def update_download_info_status(input_name, status):
|
|||
def get_download_info(input_name, status):
|
||||
logger.db('Getting download info for {0} from the DB'.format(input_name))
|
||||
|
||||
my_db = main_db.DBConnection()
|
||||
sql_results = my_db.select('SELECT * FROM downloads WHERE input_name=? AND status=?',
|
||||
[text_type(input_name), status])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue