Add support to list galleries with sort

This commit is contained in:
2023-09-08 22:09:41 +08:00
parent f6956e0989
commit de18ca304c
6 changed files with 91 additions and 8 deletions

View File

@@ -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}')

View File

@@ -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>{};