mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-22 03:44:13 +08:00
Add support to list galleries with sort
This commit is contained in:
@@ -43,6 +43,22 @@ enum ThumbnailAlign {
|
||||
static const bottom = right;
|
||||
}
|
||||
|
||||
enum SortByGid {
|
||||
none,
|
||||
asc,
|
||||
desc;
|
||||
bool? toBool() {
|
||||
switch (this) {
|
||||
case SortByGid.asc:
|
||||
return true;
|
||||
case SortByGid.desc:
|
||||
return false;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RestApi()
|
||||
abstract class _EHApi {
|
||||
factory _EHApi(Dio dio, {required String baseUrl}) = __EHApi;
|
||||
@@ -130,6 +146,7 @@ abstract class _EHApi {
|
||||
{@Query("all") bool? all,
|
||||
@Query("offset") int? offset,
|
||||
@Query("limit") int? limit,
|
||||
@Query("sort_by_gid") bool? sortByGid,
|
||||
@CancelRequest() CancelToken? cancel});
|
||||
|
||||
@GET('/tag/{id}')
|
||||
|
||||
@@ -530,6 +530,7 @@ class __EHApi implements _EHApi {
|
||||
bool? all,
|
||||
int? offset,
|
||||
int? limit,
|
||||
bool? sortByGid,
|
||||
CancelToken? cancel,
|
||||
}) async {
|
||||
const _extra = <String, dynamic>{};
|
||||
@@ -537,6 +538,7 @@ class __EHApi implements _EHApi {
|
||||
r'all': all,
|
||||
r'offset': offset,
|
||||
r'limit': limit,
|
||||
r'sort_by_gid': sortByGid,
|
||||
};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
|
||||
Reference in New Issue
Block a user