diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 05abffd..dc5eb30 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -10,9 +10,8 @@ jobs: steps: - uses: actions/checkout@v2 with: - token: ${{ secrets.PAT }} fetch-depth: 2 - - uses: salsify/action-detect-and-tag-new-version@v1.0.3 + - uses: salsify/action-detect-and-tag-new-version@v2 with: version-command: | cat VERSION \ No newline at end of file diff --git a/qbit_manage.py b/qbit_manage.py index 9911b60..b231f60 100644 --- a/qbit_manage.py +++ b/qbit_manage.py @@ -24,7 +24,7 @@ if sys.version_info[0] != 3 or sys.version_info[1] < 6: parser = argparse.ArgumentParser('qBittorrent Manager.', description='A mix of scripts combined for managing qBittorrent.') parser.add_argument("--run", dest="run", help="Run without the scheduler. Script will exit after completion.", action="store_true", default=False) -parser.add_argument("-sch", "--schedule", dest="sch", help="Schedule to run every x minutes. (Default set to 30)", default=30, type=int) +parser.add_argument("-sch", "--schedule", dest="sch", help="Schedule to run every x minutes. (Default set to 30)", default="30", type=str) parser.add_argument('-c', '--config-file', dest='config', action='store', @@ -124,6 +124,13 @@ log_file = get_arg("QBT_LOGFILE", args.logfile) default_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config") +if sch.isnumeric(): + sch = int(sch) +else: + print(f"Schedule Error: Schedule is not a number. Current value is set to '{sch}'") + sys.exit(0) + + if not os.path.exists(os.path.join(default_dir, config_file)): print(f"Config Error: config not found at {os.path.join(os.path.abspath(default_dir),config_file)}") sys.exit(0)