ModUI: Fix crash when encountering null NSFW score

Fixes #78
このコミットが含まれているのは:
Mia Herkt 2022-12-29 19:51:04 +01:00
コミット e1e99957b6
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 72E154B8622EC191
1個のファイルの変更1行の追加1行の削除

2
mod.py
ファイルの表示

@ -251,7 +251,7 @@ class NullptrMod(Screen):
("Uploaded by:", Text(f.addr)),
("Management token:", f.mgmt_token),
("Secret:", f.secret),
("Is NSFW:", ("Yes" if f.is_nsfw else "No") + f" (Score: {f.nsfw_score:0.4f})"),
("Is NSFW:", ("Yes" if f.is_nsfw else "No") + (f" (Score: {f.nsfw_score:0.4f})" if f.nsfw_score else " (Not scanned)")),
("Is banned:", "Yes" if f.removed else "No"),
("Expires:", time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(File.get_expiration(f.expiration, f.size)/1000)))
])