Propogating new variable throughout all function calls

This commit is contained in:
Chris A. Bunt
2017-06-05 21:30:36 -05:00
parent ab4b572c98
commit f3f308a812
2 changed files with 4 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ KEY: 38d39b96
Generated URL:
http://www.omdbapi.com/?t={0}&y={1}&plot=short&r=json&apikey={omdb_api_key
http://www.omdbapi.com/?t="true grit"&plot=short&4=json&apikey=38d39b96
video name example "Raising Arizona (1999)"
Files affected:

View File

@@ -48,7 +48,7 @@ def getdvdtype():
if (dvd_type == "fail"):
# first try submitting without the year
dvd_type = callwebservice(dvd_title_clean, "")
dvd_type = callwebservice(omdb_api_key, dvd_title_clean, "")
# print (dvd_type)
if (dvd_type != "fail"):
@@ -60,12 +60,12 @@ def getdvdtype():
if (dvd_title.find("-") > -1):
dvd_title_slice = dvd_title[:dvd_title.find("-")]
dvd_title_slice =cleanupstring(dvd_title_slice)
dvd_type = callwebservice(dvd_title_slice)
dvd_type = callwebservice(omdb_api_key, dvd_title_slice)
# if still fail, then try slicing off the last word in a loop
while dvd_type == "fail" and dvd_title_clean.count('+') > 0:
dvd_title_clean = dvd_title_clean.rsplit('+', 1)[0]
dvd_type = callwebservice(dvd_title_clean)
dvd_type = callwebservice(omdb_api_key, dvd_title_clean)
if needs_new_year == "true":
#pass the new year back to bash to handle