Skip to content

Commit

Permalink
fix division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmandic committed Jul 2, 2023
1 parent d61b0cf commit 875d0db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions TODO.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion modules/ui_extensions.py
Expand Up @@ -332,7 +332,7 @@ def dt(x: str):
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(' ')
Expand Down

0 comments on commit 875d0db

Please sign in to comment.