Skip to content

Commit 809c64c

Browse files
committed
Minor fixes
1 parent 3e85dad commit 809c64c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

SmartImage.Lib 3/Engines/Impl/Search/EHentaiEngine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ private Task<IFlurlResponse> GetSessionAsync(bool useEx = false)
286286
{
287287
return (useEx ? ExHentaiBase : EHentaiBase)
288288
.WithCookies(m_cookies)
289+
.WithTimeout(Timeout)
289290
.WithHeaders(new
290291
{
291292
User_Agent = HttpUtilities.UserAgent

SmartImage.Lib 3/Engines/Impl/Search/FluffleEngine.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ public override async Task<SearchResult> GetResultAsync(SearchQuery query, Cance
4949
})
5050
.WithTimeout(Timeout)
5151
.AllowAnyHttpStatus()
52+
.OnError(e =>
53+
{
54+
e.ExceptionHandled = true;
55+
})
5256
.PostMultipartAsync(c =>
5357
{
5458
// var tmp = query.WriteToFile();
59+
query.Uni.Stream.TrySeek();
5560

5661
c.AddFile("file", query.Uni.Stream, "file");
5762
query.Uni.Stream.TrySeek();
@@ -63,7 +68,7 @@ public override async Task<SearchResult> GetResultAsync(SearchQuery query, Cance
6368
// c.AddString("createLink", false)
6469
}, cancellationToken: token);
6570

66-
if (!response.ResponseMessage.IsSuccessStatusCode) {
71+
if (response is { ResponseMessage: { IsSuccessStatusCode: false } }) {
6772
var er = await response.GetJsonAsync<FluffleErrorCode>();
6873
sr.ErrorMessage = $"{er.Message}: {er.Code}";
6974
return sr;

0 commit comments

Comments
 (0)