Skip to content

Commit

Permalink
Fix typos in variables
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi311 committed Aug 28, 2024
1 parent 27797cb commit 762e5f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

load_dotenv(override=True)

logfile = os.getenv("LOGFILE", "log.log")
markfile = os.getenv("MARKFILE", "mark.log")
log_file = os.getenv("LOG_FILE", os.getenv("LOGFILE", "log.log"))
mark_file = os.getenv("MARK_FILE", os.getenv("MARKFILE", "mark.log"))


def logger(message: str, log_type=0):
Expand All @@ -32,14 +32,14 @@ def logger(message: str, log_type=0):

if output is not None:
print(output)
file = open(logfile, "a", encoding="utf-8")
file.write(output + "\n")
with open(f"{log_file}", "a", encoding="utf-8") as file:
file.write(output + "\n")


def log_marked(
username: str, library: str, movie_show: str, episode: str = None, duration=None
):
if markfile is None:
if mark_file is None:
return

output = f"{username}/{library}/{movie_show}"
Expand All @@ -50,8 +50,8 @@ def log_marked(
if duration:
output += f"/{duration}"

file = open(f"{markfile}", "a", encoding="utf-8")
file.write(output + "\n")
with open(f"{mark_file}", "a", encoding="utf-8") as file:
file.write(output + "\n")


# Reimplementation of distutils.util.strtobool due to it being deprecated
Expand Down
8 changes: 4 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ def should_sync_server(server_1_type, server_2_type):


def main_loop():
logfile = os.getenv("LOGFILE", "log.log")
# Delete logfile if it exists
if os.path.exists(logfile):
os.remove(logfile)
log_file = os.getenv("LOG_FILE", os.getenv("LOGFILE", "log.log"))
# Delete log_file if it exists
if os.path.exists(log_file):
os.remove(log_file)

dryrun = str_to_bool(os.getenv("DRYRUN", "False"))
logger(f"Dryrun: {dryrun}", 1)
Expand Down

0 comments on commit 762e5f1

Please sign in to comment.