Support download zip on web

This commit is contained in:
2023-09-16 20:11:05 +08:00
parent 9fea3946ca
commit 743aa42d34
6 changed files with 55 additions and 5 deletions

View File

@@ -209,4 +209,19 @@ class EHApi extends __EHApi {
Future<ApiResult<Tags>> getTags(List<int> ids, {CancelToken? cancel}) {
return _getTags(ids.join(","), cancel: cancel);
}
String exportGalleryZipUrl(int gid,
{bool? jpnTitle, int? maxLength, bool? exportAd}) {
final uri = Uri.parse(_combineBaseUrls(_dio.options.baseUrl, baseUrl));
var queries = {
"jpn_title": jpnTitle?.toString(),
"max_length": maxLength?.toString(),
"export_ad": exportAd?.toString(),
};
queries.removeWhere((key, value) => value == null);
final newUri = uri
.resolve("export/gallery/zip/$gid")
.replace(queryParameters: queries);
return newUri.toString();
}
}