|
|
|
@ -31,7 +31,6 @@ TMDB_TV_LINK_URL = 'https://www.themoviedb.org/tv/' |
|
|
|
# globals |
|
|
|
# globals |
|
|
|
|
|
|
|
|
|
|
|
bp = Blueprint('tmdb', __name__, url_prefix='/tmdb') |
|
|
|
bp = Blueprint('tmdb', __name__, url_prefix='/tmdb') |
|
|
|
logger = util.getLogger(Flask(__name__).config['DEBUG']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#################### |
|
|
|
#################### |
|
|
|
@ -229,7 +228,7 @@ def isQueryCached(query_str): |
|
|
|
cur.execute('SELECT COUNT(*) FROM movie_queries WHERE query=?', (query_str,)) |
|
|
|
cur.execute('SELECT COUNT(*) FROM movie_queries WHERE query=?', (query_str,)) |
|
|
|
count = cur.fetchone()[0] |
|
|
|
count = cur.fetchone()[0] |
|
|
|
|
|
|
|
|
|
|
|
logger.debug('count: "{}"'.format(count)) |
|
|
|
current_app.logger.debug('count: "{}"'.format(count)) |
|
|
|
|
|
|
|
|
|
|
|
return (count > 0) |
|
|
|
return (count > 0) |
|
|
|
|
|
|
|
|
|
|
|
@ -341,7 +340,7 @@ def storeTMDBQueryResults(query_obj, result_list): |
|
|
|
cur = conn.cursor() |
|
|
|
cur = conn.cursor() |
|
|
|
query_id = 0 |
|
|
|
query_id = 0 |
|
|
|
|
|
|
|
|
|
|
|
logger.debug('adding query string "{}" into local cache'.format(query_obj.parsed_query_str)) |
|
|
|
current_app.logger.debug('adding query string "{}" into local cache'.format(query_obj.parsed_query_str)) |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
cur.execute('BEGIN TRANSACTION') |
|
|
|
cur.execute('BEGIN TRANSACTION') |
|
|
|
|