mirror of
https://github.com/SinTan1729/TvTimeToTrakt.git
synced 2025-04-19 17:40:01 -05:00
Present menu before authentication. add entries
This commit is contained in:
parent
faa61e5075
commit
79440f7c2a
2 changed files with 31 additions and 18 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,7 +1,5 @@
|
||||||
watched_show_process_tracker.json
|
watched_show_process_tracker.json
|
||||||
localStorage.json
|
*.json
|
||||||
localStorageMovies.json
|
|
||||||
config.json
|
|
||||||
TimeToTrackt.py
|
TimeToTrackt.py
|
||||||
seen_episode.csv
|
seen_episode.csv
|
||||||
followed_tv_show.csv
|
followed_tv_show.csv
|
||||||
|
|
|
@ -778,32 +778,47 @@ def processMovies():
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
# Create the initial authentication with Trakt, before starting the process
|
|
||||||
if initTraktAuth():
|
|
||||||
# Display a menu selection
|
# Display a menu selection
|
||||||
print(">> What do you want to do?")
|
print(">> What do you want to do?")
|
||||||
print(" 1) Import Watch History for TV Shows from TV Time")
|
print(" 1) Import Watch History for TV Shows from TV Time")
|
||||||
print(" 2) Import Watch Movies from TV Time")
|
print(" 2) Import Watch Movies from TV Time")
|
||||||
|
print(" 3) Do both 1 and 2")
|
||||||
|
print(" 4) Exit")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
menuSelection = input("Enter your menu selection: ")
|
menuSelection = input("Enter your menu selection: ")
|
||||||
menuSelection = 1 if not menuSelection else int(menuSelection)
|
menuSelection = 3 if not menuSelection else int(menuSelection)
|
||||||
break
|
break
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logging.warning(
|
logging.warning(
|
||||||
"Invalid input. Please enter a numerical number.")
|
"Invalid input. Please enter a numerical number.")
|
||||||
|
# Check if the input is valid
|
||||||
|
if not 1 <= menuSelection <= 4:
|
||||||
|
logging.warning("Sorry - that's an unknown menu selection")
|
||||||
|
exit()
|
||||||
|
# Exit if the 4th option was chosen
|
||||||
|
if menuSelection == 4:
|
||||||
|
logging.info("Exiting as per user's selection.")
|
||||||
|
exit()
|
||||||
|
# Create the initial authentication with Trakt, before starting the process
|
||||||
|
if initTraktAuth():
|
||||||
# Start the process which is required
|
# Start the process which is required
|
||||||
if menuSelection == 1:
|
if menuSelection == 1:
|
||||||
# Invoke the method which will import episodes which have been watched
|
# Invoke the method which will import episodes which have been watched
|
||||||
# from TV Time into Trakt
|
# from TV Time into Trakt
|
||||||
|
logging.info("Processing watched shows.")
|
||||||
processWatchedShows()
|
processWatchedShows()
|
||||||
elif menuSelection == 2:
|
elif menuSelection == 2:
|
||||||
# Invoke the method which will import movies which have been watched
|
# Invoke the method which will import movies which have been watched
|
||||||
# from TV Time into Trakt
|
# from TV Time into Trakt
|
||||||
|
logging.info("Processing movies.")
|
||||||
|
processMovies()
|
||||||
|
elif menuSelection == 3:
|
||||||
|
# Invoke both the episodes and movies import methods
|
||||||
|
logging.info("Processing both watched shows and movies.")
|
||||||
|
processWatchedShows()
|
||||||
processMovies()
|
processMovies()
|
||||||
else:
|
|
||||||
logging.warning("Sorry - that's an unknown menu selection")
|
|
||||||
else:
|
else:
|
||||||
logging.error(
|
logging.error(
|
||||||
"ERROR: Unable to complete authentication to Trakt - please try again."
|
"ERROR: Unable to complete authentication to Trakt - please try again."
|
||||||
|
|
Loading…
Reference in a new issue