mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
a66eb65cd6
commit
a961776a3c
@ -94,7 +94,7 @@ def getinfosbyvid(proxy, vid):
|
|||||||
"vn",
|
"vn",
|
||||||
{
|
{
|
||||||
"filters": ["id", "=", vid],
|
"filters": ["id", "=", vid],
|
||||||
"fields": "tags.rating,tags.name,title,titles.title,titles.main,screenshots.url,image.url,developers.name,developers.original",
|
"fields": "tags.rating,tags.name,title,titles.title,titles.main,screenshots.url,image.url,developers.name,developers.original,va.character.name,va.character.original",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if js:
|
if js:
|
||||||
@ -113,7 +113,15 @@ def getinfosbyvid(proxy, vid):
|
|||||||
dev.append(item["name"])
|
dev.append(item["name"])
|
||||||
tags = [_["name"] for _ in js["results"][0]["tags"]]
|
tags = [_["name"] for _ in js["results"][0]["tags"]]
|
||||||
rates = [_["rating"] for _ in js["results"][0]["tags"]]
|
rates = [_["rating"] for _ in js["results"][0]["tags"]]
|
||||||
|
namemap = {}
|
||||||
|
try:
|
||||||
|
for r in js["results"][0]["va"]:
|
||||||
|
r = r["character"]
|
||||||
|
namemap[r["original"]] = r["name"]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return dict(
|
return dict(
|
||||||
|
namemap=namemap,
|
||||||
title=gettitlefromjs(js["results"][0]),
|
title=gettitlefromjs(js["results"][0]),
|
||||||
img=js["results"][0]["image"]["url"],
|
img=js["results"][0]["image"]["url"],
|
||||||
sc=imgs,
|
sc=imgs,
|
||||||
@ -122,42 +130,6 @@ def getinfosbyvid(proxy, vid):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def getcharnamemapbyid(proxy, vid):
|
|
||||||
js = safegetvndbjson(
|
|
||||||
proxy,
|
|
||||||
"character",
|
|
||||||
{
|
|
||||||
"filters": [
|
|
||||||
"vn",
|
|
||||||
"=",
|
|
||||||
["id", "=", vid],
|
|
||||||
],
|
|
||||||
"fields": "name,original",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
js2 = safegetvndbjson(
|
|
||||||
proxy,
|
|
||||||
"vn",
|
|
||||||
{
|
|
||||||
"filters": ["id", "=", vid],
|
|
||||||
"fields": "va.character.name,va.character.original",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
namemap = {}
|
|
||||||
try:
|
|
||||||
for r in js2["results"][0]["va"]:
|
|
||||||
r = r["character"]
|
|
||||||
namemap[r["original"]] = r["name"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
for r in js["results"]:
|
|
||||||
namemap[r["original"]] = r["name"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return namemap
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton_close
|
@Singleton_close
|
||||||
class vndbsettings(QDialog):
|
class vndbsettings(QDialog):
|
||||||
|
|
||||||
@ -392,10 +364,8 @@ class searcher(common):
|
|||||||
def searchfordata(self, _vid):
|
def searchfordata(self, _vid):
|
||||||
vid = "v{}".format(_vid)
|
vid = "v{}".format(_vid)
|
||||||
infos = getinfosbyvid(self.proxy, vid)
|
infos = getinfosbyvid(self.proxy, vid)
|
||||||
|
|
||||||
namemap2 = getcharnamemapbyid(self.proxy, vid)
|
|
||||||
namemap = self.getcharsfromhtml(vid)
|
namemap = self.getcharsfromhtml(vid)
|
||||||
namemap.update(namemap2)
|
namemap.update(infos["namemap"])
|
||||||
|
|
||||||
img = [
|
img = [
|
||||||
self.dispatchdownloadtask(_)
|
self.dispatchdownloadtask(_)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user