minor changes to variables etc

This commit is contained in:
Luke Arran 2021-04-09 17:13:11 +01:00
parent da00fb8705
commit 4fd33e1a21

View file

@ -14,6 +14,10 @@ import json
import re import re
import sys import sys
# Adjust this value to increase/decrease your requests between episodes.
# Make sure it's above 1 seconds to remain within the rate limit.
DELAY_BETWEEN_EPISODES_IN_SECONDS = 5
# Create a database to keep track of completed processes # Create a database to keep track of completed processes
database = TinyDB('localStorage.json') database = TinyDB('localStorage.json')
syncedEpisodesTable = database.table('SyncedEpisodes') syncedEpisodesTable = database.table('SyncedEpisodes')
@ -265,16 +269,16 @@ def processWatchedShows():
try: try:
# Sleep for a second between each process, before adding the next watched episode, # Sleep for a second between each process, before adding the next watched episode,
# this ensures that the program is within the rate limit of 1 per second. # this ensures that the program is within the rate limit of 1 per second.
time.sleep(5) time.sleep(DELAY_BETWEEN_EPISODES_IN_SECONDS)
# Output to console
print(f"({rowsCount}/{rowsTotal}) Processing Show '" + tvShowName +
"' on Season " + tvShowSeasonNo + " - Episode " + tvShowEpisodeNo)
# Get the Trakt version of the show # Get the Trakt version of the show
traktShowObj = getShowByName( traktShowObj = getShowByName(
tvShowName, tvShowSeasonNo, tvShowEpisodeNo) tvShowName, tvShowSeasonNo, tvShowEpisodeNo)
# Skip the episode, if no show was selected # Skip the episode, if no show was selected
if traktShowObj == None: if traktShowObj == None:
break break
# Output to console
print(f"({rowsCount}/{rowsTotal}) Processing Show '" + tvShowName +
"' on Season " + tvShowSeasonNo + " - Episode " + tvShowEpisodeNo)
# Add the show to the user's library # Add the show to the user's library
traktShowObj.add_to_library() traktShowObj.add_to_library()
# Get the season # Get the season