From 1369f7748048f3dce6b40e3c66f9de01663a9980 Mon Sep 17 00:00:00 2001 From: joshuagrear Date: Tue, 21 Nov 2023 13:37:47 -0600 Subject: [PATCH] FIX: Preview images updated even with the "Download NSFW (adult) preview images" unchecked. Updating to allow preview images to be updated even with the "Download NSFW (adult) preview images" unchecked. It appears that the 'nsfw' value used to be True|False, and is now a string with values like None, Mature, X, etc. --- scripts/previews.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/previews.py b/scripts/previews.py index 60bf532..b2e0953 100644 --- a/scripts/previews.py +++ b/scripts/previews.py @@ -47,7 +47,7 @@ def load_previews(): hash = file['hashes']['SHA256'] if hash.lower() not in hashes: continue images = r['images'] - if (nsfw_previews is False): images = [i for i in images if i['nsfw'] is False] + if (nsfw_previews is False): images = [i for i in images if i['nsfw'] == 'None'] if (len(images) == 0): continue image_url = images[0]['url'] civitai.update_resource_preview(hash, image_url)