more logging

This commit is contained in:
2022-04-23 09:39:06 -04:00
parent 5dfacd4d18
commit c03c0e6e9a

View File

@@ -70,6 +70,7 @@ def movie_lookup(movie):
if movie_id == "404": if movie_id == "404":
tg_reply = ("I'm having trouble finding that movie\. " + tg_reply = ("I'm having trouble finding that movie\. " +
"Check your spelling and try again\.") "Check your spelling and try again\.")
logger.info('Movie not found in TMDB.')
similarity = 0 similarity = 0
return tg_reply, similarity return tg_reply, similarity
@@ -77,6 +78,7 @@ def movie_lookup(movie):
if sa_response == "404": if sa_response == "404":
tg_reply = ("I'm having trouble finding that movie\. " + tg_reply = ("I'm having trouble finding that movie\. " +
"Check your spelling and try again\.") "Check your spelling and try again\.")
logger.info('Movie not found by the Streaming Availability API.')
similarity = 0 similarity = 0
return tg_reply, similarity return tg_reply, similarity
@@ -119,6 +121,7 @@ def input_movie(update: Update, context: CallbackContext):
context.bot.send_message(chat_id=update.effective_chat.id, context.bot.send_message(chat_id=update.effective_chat.id,
text=movie_info, parse_mode=ParseMode.MARKDOWN_V2) text=movie_info, parse_mode=ParseMode.MARKDOWN_V2)
if similarity < .80 and similarity != 0: if similarity < .80 and similarity != 0:
logger.info("Result accuracy was below the threshold. Sending follow-up message.")
followup_msg = ("Not the movie you're looking for? " + followup_msg = ("Not the movie you're looking for? " +
"Try adding '\-year' followed by the release year after the title\.") "Try adding '\-year' followed by the release year after the title\.")
context.bot.send_message(chat_id=update.effective_chat.id, context.bot.send_message(chat_id=update.effective_chat.id,