Skip to content

Commit 4aa113b

Browse files
committed
fix
1 parent 29e4dd6 commit 4aa113b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/fetcher.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub struct Problems {
175175

176176
#[derive(Debug, Serialize, Deserialize)]
177177
pub struct StatWithStatus {
178-
stat: Stat,
178+
pub stat: Stat,
179179
difficulty: Difficulty,
180180
paid_only: bool,
181181
is_favor: bool,
@@ -184,7 +184,7 @@ pub struct StatWithStatus {
184184
}
185185

186186
#[derive(Debug, Serialize, Deserialize)]
187-
struct Stat {
187+
pub struct Stat {
188188
question_id: u32,
189189
#[serde(rename = "question__article__slug")]
190190
question_article_slug: Option<String>,
@@ -196,7 +196,7 @@ struct Stat {
196196
question_hide: bool,
197197
total_acs: u32,
198198
total_submitted: u32,
199-
frontend_question_id: u32,
199+
pub frontend_question_id: u32,
200200
is_new_question: bool,
201201
}
202202

src/main.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() {
3030
"Please enter a frontend problem id, \n\
3131
or \"random\" to generate a random one, \n\
3232
or \"solve $i\" to move problem to solution/, \n\
33-
or \"all\" to initialize all problems"
33+
or \"all\" to initialize all problems \n"
3434
);
3535
let mut is_random = false;
3636
let mut is_solving = false;
@@ -71,6 +71,9 @@ fn main() {
7171
let problems = fetcher::get_problems().unwrap();
7272
let mut mod_file_addon = Arc::new(Mutex::new(vec![]));
7373
for problem_stat in problems.stat_status_pairs {
74+
if initialized_ids.contains(&problem_stat.stat.frontend_question_id) {
75+
continue;
76+
}
7477
let mod_file_addon = mod_file_addon.clone();
7578
tasks.push(
7679
pool.spawn_with_handle(async move {

0 commit comments

Comments
 (0)