Update git, versions, updater for complete update of newznab-tmux

This commit is contained in:
DariusIII
2016-04-19 00:39:14 +02:00
parent 503c469ce9
commit 3da0cfcf50
16 changed files with 268 additions and 170 deletions
+2 -2
View File
@@ -78,9 +78,9 @@ while count < 10000:
#query to grab backfill groups
if len(sys.argv) == 1:
if conf['DB_TYPE'] == "mysql":
if conf['DB_SYSTEM'] == "mysql":
cur[0].execute("SELECT g.name, g.first_record AS our_first, MAX(a.first_record) AS thier_first, MAX(a.last_record) AS their_last FROM groups g INNER JOIN short_groups a ON g.name = a.name WHERE g.first_record IS NOT NULL AND g.first_record_postdate IS NOT NULL AND g.backfill = 1 AND (NOW() - INTERVAL %s DAY) < g.first_record_postdate AND g.name NOT IN (%s) GROUP BY a.name, a.last_record, g.name, g.first_record %s LIMIT 1" % (backfilldays, previous, group))
elif conf['DB_TYPE'] == "pgsql":
elif conf['DB_SYSTEM'] == "pgsql":
cur[0].execute("SELECT g.name, g.first_record AS our_first, MAX(a.first_record) AS thier_first, MAX(a.last_record) AS their_last FROM groups g INNER JOIN short_groups a ON g.name = a.name WHERE g.first_record IS NOT NULL AND g.first_record_postdate IS NOT NULL AND g.backfill = 1 AND (NOW() - INTERVAL '%s DAYS') < g.first_record_postdate GROUP BY a.name, a.last_record, g.name, g.first_record %s LIMIT 1" % (backfilldays, group, groups))
datas = cur[0].fetchone()
else:
+2 -2
View File
@@ -63,9 +63,9 @@ if len(sys.argv) > 1 and sys.argv[1] == "all":
# removing the % before the variables at the end of the query adds quotes/escapes strings
cur[0].execute("SELECT name, first_record FROM groups WHERE first_record != 0 AND backfill = 1 %s" % (group))
else:
if conf['DB_TYPE'] == "mysql":
if conf['DB_SYSTEM'] == "mysql":
cur[0].execute("SELECT name, first_record FROM groups WHERE first_record != 0 AND first_record_postdate IS NOT NULL AND backfill = 1 AND (NOW() - interval %s DAY) < first_record_postdate %s LIMIT %s" % (backfilldays, group, groups))
elif conf['DB_TYPE'] == "pgsql":
elif conf['DB_SYSTEM'] == "pgsql":
cur[0].execute("SELECT name, first_record FROM groups WHERE first_record != 0 AND first_record_postdate IS NOT NULL AND backfill = 1 AND (NOW() - interval '%s DAYS') < first_record_postdate %s LIMIT %s" % (backfilldays, group, groups))
datas = cur[0].fetchall()
+2 -2
View File
@@ -18,7 +18,7 @@ pathname = os.path.abspath(os.path.dirname(sys.argv[0]))
def connect():
conf = readConfig()
con = None
if conf['DB_TYPE'] == "mysql":
if conf['DB_SYSTEM'] == "mysql":
try:
import cymysql as mdb
if conf['DB_PORT'] != '':
@@ -28,7 +28,7 @@ def connect():
except ImportError:
print(bcolors.ERROR + "\nPlease install cymysql for python 3, \ninformation can be found in threaded_scripts_readme.txt\n" + bcolors.ENDC)
sys.exit()
elif conf['DB_TYPE'] == "pgsql":
elif conf['DB_SYSTEM'] == "pgsql":
try:
import psycopg2 as mdb
con = mdb.connect(host=conf['DB_HOST'], user=conf['DB_USER'], password=conf['DB_PASSWORD'], dbname=conf['DB_NAME'], port=int(conf['DB_PORT']))