From 85cffb332da9361492e135983dd3a89bdffe551c Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Thu, 7 Apr 2022 11:28:30 +0100 Subject: [PATCH] no log: Added `NO_UPDATE` env var (#1791) --- bazarr/get_args.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bazarr/get_args.py b/bazarr/get_args.py index 604b6ab59..1793bd72b 100644 --- a/bazarr/get_args.py +++ b/bazarr/get_args.py @@ -5,6 +5,7 @@ import argparse from distutils.util import strtobool +no_update = bool(os.environ.get("NO_UPDATE", False)) parser = argparse.ArgumentParser() @@ -16,8 +17,9 @@ def get_args(): dest="config_dir", help="Directory containing the configuration (default: %s)" % config_dir) parser.add_argument('-p', '--port', type=int, metavar="PORT", dest="port", help="Port number (default: 6767)") - parser.add_argument('--no-update', default=False, type=bool, const=True, metavar="BOOL", nargs="?", - help="Disable update functionality (default: False)") + if not no_update: + parser.add_argument('--no-update', default=False, type=bool, const=True, metavar="BOOL", nargs="?", + help="Disable update functionality (default: False)") parser.add_argument('--debug', default=False, type=bool, const=True, metavar="BOOL", nargs="?", help="Enable console debugging (default: False)") parser.add_argument('--release-update', default=False, type=bool, const=True, metavar="BOOL", nargs="?", @@ -31,3 +33,5 @@ def get_args(): args = get_args() +if no_update: + args.no_update = True