From 375c6822f1f53504bcbabe2edd1850f27cfcfd29 Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 19:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=AF=84=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core.py b/core.py index f7cb5ba..befa3d5 100644 --- a/core.py +++ b/core.py @@ -355,13 +355,10 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f print(" " + release + "", file=code) print(" " + release + "", file=code) try: - strrating = json_data['userrating'] - userrating = round(float(strrating) * 2.0) - print(f" {userrating}", file=code) - rating = round(float(strrating) * 2.0, 1) - print(f" {rating}", file=code) - rating_score = round(float(strrating) * 20.0, 1) - print(f" {rating_score}", file=code) + f_rating = float(json_data['userrating']) + print(f" {round(f_rating * 2.0)}", file=code) + print(f" {round(f_rating * 2.0, 1)}", file=code) + print(f" {round(f_rating * 20.0, 1)}", file=code) except: pass print(" " + cover + "", file=code)