Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-#13 #14

Merged
merged 1 commit into from
Jul 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions AdnmbBackup-gui/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ private void button1_Click(object sender, EventArgs e)
MessageBox.Show(id + "失败,错误信息:" + errMessage + ",请检查cookie是否正确");
}
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
if (replyCount % pageCount != 0) pageCount++;
int pageCount = 1;
if (replyCount >= 19) {
pageCount = replyCount / 19;
if (replyCount % 19 != 0) pageCount++;
}
for (int page = pageCountInCache; page <= pageCount; page++)
{
label4.Text = "第" + page + "页";
Expand Down Expand Up @@ -163,8 +166,11 @@ private void button1_Click(object sender, EventArgs e)
MessageBox.Show(id + "失败,错误信息:" + errMessage + ",请检查cookie是否正确");
}
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
if (replyCount % pageCount != 0) pageCount++;
int pageCount = 1;
if (replyCount >= 19) {
pageCount = replyCount / 19;
if (replyCount % 19 != 0) pageCount++;
}
JArray contentJA = fpjson["Replies"].ToObject<JArray>();
for (var page = 2; page <= pageCount; page++)
{
Expand Down Expand Up @@ -497,8 +503,11 @@ private void Form1_Shown(object sender, EventArgs e)
catch (Exception) { label4.Text = "串" + id + "可能已被删除"; errCount++; err.Add("[" + DateTime.Now.ToString() + "] 串 " + id + " 可能已被删除,最后备份于:" + File.GetLastWriteTime(path)); err.Add(" "); continue; }
var fpjson = JsonConvert.DeserializeObject<JObject>(str);
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
if (replyCount % pageCount != 0) pageCount++;
int pageCount = 1;
if (replyCount >= 19) {
pageCount = replyCount / 19;
if (replyCount % 19 != 0) pageCount++;
}
label4.Text = "第" + pageCountInCache + "页";
for (int page = pageCountInCache; page <= pageCount; page++)
{
Expand Down Expand Up @@ -551,8 +560,11 @@ private void Form1_Shown(object sender, EventArgs e)
label4.Text = str;
var fpjson = JsonConvert.DeserializeObject<JObject>(str);
var replyCount = int.Parse(fpjson["ReplyCount"].ToString());
int pageCount = replyCount / 19;
if (replyCount % pageCount != 0) pageCount++;
int pageCount = 1;
if (replyCount >= 19) {
pageCount = replyCount / 19;
if (replyCount % 19 != 0) pageCount++;
}
JArray contentJA = fpjson["Replies"].ToObject<JArray>();
for (var page = 2; page <= pageCount; page++)
{
Expand Down
Loading