mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 04:57:23 +00:00
load illust with id; context menu
This commit is contained in:
@@ -233,6 +233,7 @@ class DownloadManager {
|
||||
}
|
||||
|
||||
void addDownloadingTask(Illust illust) {
|
||||
if(illust.downloaded || illust.downloading) return;
|
||||
var task = DownloadingTask(illust, receiveBytesCallback: receiveBytes, onCompleted: (task) {
|
||||
saveInfo(illust, task.imagePaths);
|
||||
tasks.remove(task);
|
||||
|
@@ -391,4 +391,13 @@ class Network {
|
||||
return Res.fromErrorRes(res);
|
||||
}
|
||||
}
|
||||
|
||||
Future<Res<Illust>> getIllustByID(String id) async {
|
||||
var res = await apiGet("/v1/illust/detail?illust_id=$id");
|
||||
if (res.success) {
|
||||
return Res(Illust.fromJson(res.data["illust"]));
|
||||
} else {
|
||||
return Res.error(res.errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user