-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes performance regression in downloading
Rollback to Refit. The performance in downloading while using restsharp is incredibly slow and falling back to refit solves the performance issue. I may wrongly use restsharp though.
- Loading branch information
Showing
6 changed files
with
97 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using asuka.Provider.Nhentai.Api.Requests; | ||
using asuka.Provider.Nhentai.Contracts; | ||
using Refit; | ||
|
||
namespace asuka.Provider.Nhentai.Api; | ||
|
||
internal interface IGalleryApi | ||
{ | ||
[Get("/api/gallery/{code}")] | ||
Task<GalleryResponse> FetchSingle(string code, CancellationToken cancellationToken = default); | ||
|
||
[Get("/api/gallery/{code}/related")] | ||
Task<GalleryListResponse> FetchRecommended(string code, CancellationToken cancellationToken = default); | ||
|
||
[Get("/api/galleries/search")] | ||
Task<GallerySearchResponse> SearchGallery(GallerySearchQuery queries, CancellationToken cancellationToken = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Refit; | ||
|
||
namespace asuka.Provider.Nhentai.Api; | ||
|
||
internal interface IGalleryImage | ||
{ | ||
[Get("/galleries/{mediaId}/{filename}")] | ||
Task<HttpContent> GetImage(string mediaId, string filename, CancellationToken cancellationToken = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Refit; | ||
|
||
namespace asuka.Provider.Nhentai.Api.Requests; | ||
|
||
internal sealed class GallerySearchQuery | ||
{ | ||
[AliasAs("query")] | ||
public required string Queries { get; init; } | ||
|
||
[AliasAs("page")] | ||
public int PageNumber { get; init; } | ||
|
||
[AliasAs("sort")] | ||
public required string Sort { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters