mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix batch downloader
This commit is contained in:
@@ -32,9 +32,9 @@ pub struct CreateTaskData {
|
|||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Task {
|
pub struct Task {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub object_id: u32,
|
|
||||||
pub object_type: TaskObjectType,
|
|
||||||
pub status: TaskStatus,
|
pub status: TaskStatus,
|
||||||
|
pub status_description: String,
|
||||||
|
pub error_message: Option<String>,
|
||||||
pub result_filename: Option<String>,
|
pub result_filename: Option<String>,
|
||||||
pub result_link: Option<String>,
|
pub result_link: Option<String>,
|
||||||
}
|
}
|
||||||
@@ -46,6 +46,7 @@ pub async fn create_task(
|
|||||||
.post(format!("{}/api/", &config::CONFIG.batch_downloader_url))
|
.post(format!("{}/api/", &config::CONFIG.batch_downloader_url))
|
||||||
.body(serde_json::to_string(&data).unwrap())
|
.body(serde_json::to_string(&data).unwrap())
|
||||||
.header("Authorization", &config::CONFIG.batch_downloader_api_key)
|
.header("Authorization", &config::CONFIG.batch_downloader_api_key)
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.error_for_status()?
|
.error_for_status()?
|
||||||
|
|||||||
Reference in New Issue
Block a user