KODI评分显示投票人数

This commit is contained in:
lededev
2022-03-27 20:38:36 +08:00
parent 8d3ee88cde
commit 761fc762f2
2 changed files with 16 additions and 7 deletions

15
core.py
View File

@@ -355,10 +355,17 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
print(" <releasedate>" + release + "</releasedate>", file=code)
print(" <release>" + release + "</release>", file=code)
try:
f_rating = float(json_data['userrating'])
print(f" <userrating>{round(f_rating * 2.0)}</userrating>", file=code)
print(f" <rating>{round(f_rating * 2.0, 1)}</rating>", file=code)
print(f" <criticrating>{round(f_rating * 20.0, 1)}</criticrating>", file=code)
f_rating = json_data['用户评分']
uc = json_data['评分人数']
print(f""" <userrating>{round(f_rating * 2.0)}</userrating>
<rating>{round(f_rating * 2.0, 1)}</rating>
<criticrating>{round(f_rating * 20.0, 1)}</criticrating>
<ratings>
<rating name="javdb" max="5" default="true">
<value>{f_rating}</value>
<votes>{uc}</votes>
</rating>
</ratings>""", file=code)
except:
pass
print(" <cover>" + cover + "</cover>", file=code)