Skip to content

Commit

Permalink
Merge pull request #118 from noriokun4649/fix_5ch
Browse files Browse the repository at this point in the history
Fix 5ch
  • Loading branch information
noriokun4649 authored Oct 5, 2024
2 parents 83d3242 + e2f3db2 commit 436774d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion TVTComment/Model/Nichan/DatParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ public void Feed(string datString)
reses = reses[1..];
}

// 6フィールドでも実害がなさそうなのでエラー出さずに無視する
// 運営スレが6フィールドになる模様?
// 通常は5フィールドだが、なぜか先頭行が6フィールドあるdatが確認されている
/*
if (!reses.All(x => x.Length >= 5))
{
throw new DatParserException();
//throw new DatParserException();
}
*/

if (isFirstLine && !FromTheMiddle)
{
Expand Down
7 changes: 7 additions & 0 deletions TVTComment/Model/Nichan/DatThreadLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ public async Task Update(ApiClient apiClient)
await Update(apiClient);
return;
}
else if (response.StatusCode == HttpStatusCode.NotFound)
{
// 過去のレスが削除などで見つからない→全体再取得
(loadedNumBytes, lastModified) = (0, "");
await Update(apiClient);
return;
}
else
{
throw new ResponseApiClientException();
Expand Down

0 comments on commit 436774d

Please sign in to comment.