Merge pull request #2426 from D8-Dreambooth/master

Fix potential issues parsing extension repo URLs
This commit is contained in:
Vladimir Mandic
2023-10-31 00:36:31 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -56,6 +56,7 @@ cache
/log
/cert
.vscode/
.idea/
/localizations
# unexcluded so folders get created
+5 -2
View File
@@ -318,9 +318,12 @@ def create_html(search_text, sort_column):
stats = { 'processed': 0, 'enabled': 0, 'hidden': 0, 'installed': 0 }
for ext in sorted(extensions_list, key=sort_function, reverse=sort_reverse):
installed = get_installed(ext)
author = f"Author: {ext['url'].split('/')[3]}" if 'github' in ext['url'] else ''
author = ''
try:
updated = datetime.timestamp(datetime.fromisoformat(ext.get('updated', '2000-01-01T00:00:00.000Z').rstrip('Z')))
if 'github' in ext_url:
author = ext_url.split('/')[-2].split(':')[-1] if '/' in ext_url else ext_url.split(':')[1].split('/')[0]
author = f"Author: {author}"
updated = datetime.timestamp(datetime.fromisoformat(ext.get('updated', '2000-01-01T00:00:00.000Z').rstrip('Z')))
except Exception:
updated = datetime.timestamp(datetime.now())
update_available = (installed is not None) and (ext['remote'] is not None) and (ext['commit_date'] + 60 * 60 < updated)