简化评分代码
This commit is contained in:
11
core.py
11
core.py
@@ -355,13 +355,10 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
|
|||||||
print(" <releasedate>" + release + "</releasedate>", file=code)
|
print(" <releasedate>" + release + "</releasedate>", file=code)
|
||||||
print(" <release>" + release + "</release>", file=code)
|
print(" <release>" + release + "</release>", file=code)
|
||||||
try:
|
try:
|
||||||
strrating = json_data['userrating']
|
f_rating = float(json_data['userrating'])
|
||||||
userrating = round(float(strrating) * 2.0)
|
print(f" <userrating>{round(f_rating * 2.0)}</userrating>", file=code)
|
||||||
print(f" <userrating>{userrating}</userrating>", file=code)
|
print(f" <rating>{round(f_rating * 2.0, 1)}</rating>", file=code)
|
||||||
rating = round(float(strrating) * 2.0, 1)
|
print(f" <criticrating>{round(f_rating * 20.0, 1)}</criticrating>", file=code)
|
||||||
print(f" <rating>{rating}</rating>", file=code)
|
|
||||||
rating_score = round(float(strrating) * 20.0, 1)
|
|
||||||
print(f" <criticrating>{rating_score}</criticrating>", file=code)
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
print(" <cover>" + cover + "</cover>", file=code)
|
print(" <cover>" + cover + "</cover>", file=code)
|
||||||
|
|||||||
Reference in New Issue
Block a user