From fa9fb9ab089b5dabe2d739e21017e8688c5351c2 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 2 Dec 2025 15:34:43 -0700 Subject: [PATCH] Not checking for updates when WROL Mode is enabled. --- main.py | 2 ++ wrolpi/collections/lib.py | 6 +++--- wrolpi/upgrade.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 8abff9af..9109619a 100755 --- a/main.py +++ b/main.py @@ -393,6 +393,8 @@ async def perpetual_check_for_updates(): if result.get('update_available'): logger.info(f"Update available: {result['commits_behind']} commits behind on {result['branch']}") + except WROLModeEnabled: + logger.debug('Refusing to check for updates when WROL Mode is enabled.') except Exception as e: logger.error('Failed to check for updates', exc_info=e) diff --git a/wrolpi/collections/lib.py b/wrolpi/collections/lib.py index 00917598..bd8d4dac 100644 --- a/wrolpi/collections/lib.py +++ b/wrolpi/collections/lib.py @@ -217,7 +217,7 @@ def get_collection_metadata(kind: str) -> dict: {'key': 'actions', 'label': 'Manage', 'sortable': False, 'type': 'actions'} ], 'fields': [ - {'key': 'directory', 'label': 'Directory', 'type': 'text', + {'key': 'directory', 'label': 'Directory', 'type': 'directory', 'placeholder': 'Optional directory path'}, {'key': 'tag_name', 'label': 'Tag', 'type': 'tag', 'placeholder': 'Select or create tag', 'depends_on': 'directory'}, @@ -249,7 +249,7 @@ def get_collection_metadata(kind: str) -> dict: 'fields': [ {'key': 'name', 'label': 'Name', 'type': 'text', 'required': True}, {'key': 'url', 'label': 'URL', 'type': 'text', 'placeholder': 'Channel URL'}, - {'key': 'directory', 'label': 'Directory', 'type': 'text', 'required': True}, + {'key': 'directory', 'label': 'Directory', 'type': 'directory', 'required': True}, {'key': 'tag_name', 'label': 'Tag', 'type': 'tag', 'placeholder': 'Select or create tag'}, {'key': 'description', 'label': 'Description', 'type': 'textarea', @@ -279,7 +279,7 @@ def get_collection_metadata(kind: str) -> dict: ], 'fields': [ {'key': 'name', 'label': 'Name', 'type': 'text', 'required': True}, - {'key': 'directory', 'label': 'Directory', 'type': 'text'}, + {'key': 'directory', 'label': 'Directory', 'type': 'directory'}, {'key': 'tag_name', 'label': 'Tag', 'type': 'tag'}, {'key': 'description', 'label': 'Description', 'type': 'textarea'} ], diff --git a/wrolpi/upgrade.py b/wrolpi/upgrade.py index 6100f123..a8ef4741 100644 --- a/wrolpi/upgrade.py +++ b/wrolpi/upgrade.py @@ -7,7 +7,7 @@ with the remote origin branch, and to trigger the upgrade process. import pathlib import subprocess -from wrolpi.common import logger +from wrolpi.common import logger, wrol_mode_check from wrolpi.vars import DOCKERIZED, PROJECT_DIR logger = logger.getChild(__name__) @@ -144,6 +144,7 @@ def get_commits_behind(branch: str) -> int: return 0 +@wrol_mode_check def check_for_update(fetch: bool = True) -> dict: """ Check if an update is available by comparing local HEAD with origin/{branch}.