build 0004
Negative promt
This commit is contained in:
@@ -52,10 +52,15 @@ def hentai_autoc(cut_tag):
|
|||||||
tagss = dataf["tags"]
|
tagss = dataf["tags"]
|
||||||
count = 0
|
count = 0
|
||||||
list_res = []
|
list_res = []
|
||||||
|
if cut_tag[0] == "-":
|
||||||
|
prefix = "-"
|
||||||
|
cut_tag = cut_tag[1:]
|
||||||
|
else:
|
||||||
|
prefix = ""
|
||||||
for ii in tagss:
|
for ii in tagss:
|
||||||
if ii.startswith(cut_tag, 0):
|
if ii.startswith(cut_tag, 0):
|
||||||
count += 1
|
count += 1
|
||||||
list_res.append(ii)
|
list_res.append(prefix+ii)
|
||||||
json_resp = {"count":count,"list":list_res}
|
json_resp = {"count":count,"list":list_res}
|
||||||
response = jsonify(json_resp)
|
response = jsonify(json_resp)
|
||||||
response.headers.add('Access-Control-Allow-Origin', '*')
|
response.headers.add('Access-Control-Allow-Origin', '*')
|
||||||
@@ -76,18 +81,30 @@ def hentai_search(types, tags):
|
|||||||
print(types)
|
print(types)
|
||||||
if tags[-1] == "+":
|
if tags[-1] == "+":
|
||||||
tags = tags[:-1]
|
tags = tags[:-1]
|
||||||
tagsp = tags.split("+")
|
tagspmix = tags.split("+")
|
||||||
|
tagspok = []
|
||||||
|
tagspdel = []
|
||||||
|
for ttt in tagspmix:
|
||||||
|
if ttt[0] == "-":
|
||||||
|
tagspdel.append(ttt[1:])
|
||||||
|
else:
|
||||||
|
tagspok.append(ttt)
|
||||||
dataf = json.load(open(root_folder+"data_info.json", "r", encoding='utf-8'))
|
dataf = json.load(open(root_folder+"data_info.json", "r", encoding='utf-8'))
|
||||||
posts = dataf["data_set"]
|
posts = dataf["data_set"]
|
||||||
count = 0
|
count = 0
|
||||||
list_res = []
|
list_res = []
|
||||||
for ii in posts:
|
for ii in posts:
|
||||||
contun = 2
|
contun = 2
|
||||||
for dd in tagsp:
|
for dd in tagspok:
|
||||||
if dd in ii["tags"]:
|
if dd in ii["tags"]:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
contun -= 1
|
contun -= 1
|
||||||
|
for dd in tagspdel:
|
||||||
|
if dd not in ii["tags"]:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
contun -= 1
|
||||||
if types == "mix":
|
if types == "mix":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user