File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ def load_ratings():
11
11
with open ("rating.json" , "r" , encoding = "utf-8" ) as f :
12
12
ratings = json .loads (f .read ())
13
13
for item in ratings :
14
- res [item ["ID" ]] = item
14
+ res [str ( item ["ID" ]) ] = item
15
15
16
16
url = "https://zerotrac.github.io/leetcode_problem_rating/data.json"
17
17
try :
18
18
resp = requests .get (url )
19
19
if resp .status_code == 200 :
20
20
ratings = resp .json ()
21
21
for item in ratings :
22
- res [item ["ID" ]] = item
22
+ res [str ( item ["ID" ]) ] = item
23
23
except Exception as e :
24
24
print (f"Failed to fetch ratings: { e } " )
25
25
return res
@@ -143,6 +143,10 @@ def get_paths(dirs: str, m: int):
143
143
elif num .endswith ("- I" ):
144
144
num = num [:- 3 ] + ".1"
145
145
num = "." .join ([x .strip (" " ).lstrip ("0" ) for x in num .split ("." )])
146
+ rat = - 1
147
+ if target_dir == 'lc' and num in rating_dict :
148
+ rat = int (rating_dict [num ]['Rating' ])
149
+ print (f"Rating: { num } { rat } " )
146
150
is_en = "README_EN" in p
147
151
if is_en :
148
152
navdata_en [dir ].append (f" - { num } . { name } : { target_dir } /{ num } .md" )
You can’t perform that action at this time.
0 commit comments