fix division by zero

This commit is contained in:
Vladimir Mandic
2023-07-02 08:26:51 -04:00
parent d61b0cfd4c
commit 875d0db103
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -57,3 +57,5 @@ Tech that can be integrated as part of the core workflow...
- image `imagehash` phash and hdash
- custom exif tags
- replace lightbox with iv-viewer
- git-rebasin
- additional upscalers
+1 -1
View File
@@ -332,7 +332,7 @@ def refresh_extensions_list_from_data(search_text, sort_column):
ext['sort_enabled'] = f"{'0' if ext['enabled'] else '1'}{'1' if ext['is_builtin'] else '0'}{'1' if ext['installed'] else '0'}{ext.get('updated', '2000-01-01T00:00')}"
ext['sort_update'] = f"{'1' if update_available else '0'}{'1' if ext['installed'] else '0'}{ext.get('updated', '2000-01-01T00:00')}"
timedelta = datetime.now() - datetime.fromisoformat(ext.get('created', '2000-01-01T00:00Z')[:-1])
ext['sort_trending'] = round(stars / min(timedelta.days, 5), 1)
ext['sort_trending'] = round(stars / max(timedelta.days, 5), 1)
tags = ext.get("tags", [])
if not isinstance(tags, list):
tags = tags.split(' ')