Not checking for updates when WROL Mode is enabled.

This commit is contained in:
Roland 2025-12-02 15:34:43 -07:00 • committed by lrnselfreliance
parent 269a1f6570
commit fa9fb9ab08
3 changed files with 7 additions and 4 deletions

View file

@ -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)

View file

@ -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'}
],

View file

@ -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}.