Skip to content

Commit

Permalink
fix(parser): 完善饼干错误检测
Browse files Browse the repository at this point in the history
Fix #10
  • Loading branch information
Ovler-Young committed Jul 29, 2023
1 parent a958eb5 commit 9d1f2a2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions AdnmbBackup-gui/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ private void button1_Click(object sender, EventArgs e)
try { str = ReadGzip(bytes); }
catch (Exception) { label4.Text = "串" + id + "可能已被删除"; MessageBox.Show("串" + id + "可能已被删除,本地仍保留缓存"); return; }
var fpjson = JsonConvert.DeserializeObject<JObject>(str);
if (fpjson["Success"].ToString() == "False")
if (fpjson.ContainsKey("success"))
{
var errMessage = fpjson["error"].ToString();
MessageBox.Show(id + "失败,错误信息:" + errMessage + ",请检查cookie是否正确");
MessageBox.Show("备份" + id + "失败" + errMessage + ",请检查cookie是否正确");
}
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
Expand Down Expand Up @@ -161,12 +161,11 @@ private void button1_Click(object sender, EventArgs e)
MessageBox.Show("串" + id + "已被删");
return;
}
label4.Text = str;
var fpjson = JsonConvert.DeserializeObject<JObject>(str);
if (fpjson["Success"].ToString() == "False")
if (fpjson.ContainsKey("success"))
{
var errMessage = fpjson["error"].ToString();
MessageBox.Show(id + "失败,错误信息:" + errMessage + ",请检查cookie是否正确");
MessageBox.Show("备份" + id + "失败" + errMessage + ",请检查cookie是否正确");
}
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
Expand Down Expand Up @@ -641,7 +640,6 @@ private void Form1_Shown(object sender, EventArgs e)
MessageBox.Show("串" + id + "已被删");
return;
}
label4.Text = str;
var fpjson = JsonConvert.DeserializeObject<JObject>(str);
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
Expand Down

0 comments on commit 9d1f2a2

Please sign in to comment.