Browse Source

remove tmdb api key property from query_data

master
cinnaboot 7 years ago
parent
commit
2b498c5ac6
  1. 6
      video_metadata/views/tmdb.py

6
video_metadata/views/tmdb.py

@ -51,7 +51,6 @@ class query_data:
query_type = query_type.UNKNOWN
raw_query_str = ''
rel_path = ''
tmdb_api_key = ''
@dataclass
class response_data:
@ -108,7 +107,6 @@ def query_movie():
query = query_data()
response = response_data()
view_results = []
query.tmdb_api_key = current_app.config['TMDB_API_KEY']
# NOTE: query string can be submitted from a link or form input
# form input comes from the query.html template and the links
@ -228,7 +226,7 @@ def isQueryCached(query_str):
cur.execute('SELECT COUNT(*) FROM movie_queries WHERE query=?', (query_str,))
count = cur.fetchone()[0]
current_app.logger.debug('count: "{}"'.format(count))
current_app.logger.debug('movie_queries count: "{}, query: {}"'.format(count, query_str))
return (count > 0)
@ -279,7 +277,7 @@ def makeTMDBQuery(query_obj, response_obj):
request_headers = {"Accept": "text/html,application/xhtml+xml,application/xml"}
query_obj.query_params = urllib.parse.urlencode(
{
'api_key': query_obj.tmdb_api_key,
'api_key': current_app.config['TMDB_API_KEY'],
'query': query_obj.parsed_query_str,
'year': query_obj.movie_year,
}

Loading…
Cancel
Save