Minor fix

This commit is contained in:
2023-11-06 06:27:51 +00:00
committed by GitHub
parent 4b579f5966
commit 4c28fdd05f
4 changed files with 15 additions and 11 deletions

View File

@@ -3,10 +3,10 @@ pub mod status;
pub mod token;
pub mod user;
pub use pubkey::{AuthPubkeyContext, AuthPubkeyRoute, RSAKey};
pub use status::{AuthStatusContext, AuthStatusRoute};
pub use token::{revoke_expired_tokens, AuthTokenContext, AuthTokenRoute};
pub use user::{AuthUserContext, AuthUserRoute};
pub use pubkey::{AuthPubkeyRoute, RSAKey};
pub use status::AuthStatusRoute;
pub use token::{revoke_expired_tokens, AuthTokenRoute};
pub use user::AuthUserRoute;
const PASSWORD_SALT: [u8; 64] = [
14, 169, 19, 53, 220, 112, 183, 235, 112, 165, 131, 132, 68, 29, 167, 65, 150, 219, 121, 212,

View File

@@ -1,7 +1,6 @@
pub use super::body::hyper::HyperBody;
pub use super::body::response::ResponseBody;
pub use super::context::ServerContext;
pub use super::params::RequestParams;
pub use super::result::{JSONResult, SerdeJSONResult};
pub use super::route::ResponseForType;
pub use super::traits::{GetRequestParams, MatchRoute, ResponseFor, ResponseJsonFor};

View File

@@ -1,4 +1,4 @@
pub mod index;
pub mod task;
pub use index::{PushContext, PushRoute};
pub use index::PushRoute;

View File

@@ -80,7 +80,7 @@ impl<'a> RunContext<'a> {
first_run: AtomicBool::new(false),
push_manager: TaskManagerWithId::new(
Arc::new(Mutex::new(0)),
MaxCount::new(helper.push_task_max_count()),
MaxCount::new(helper.push_task_max_push_count()),
),
}
}
@@ -212,10 +212,15 @@ impl<'a> RunContext<'a> {
Some(d) => d,
None => {
let pw = self.ctx.pixiv_web_client().await;
let wdata = pw
.get_artwork_ajax(id)
.await
.ok_or("Failed to get artwork ajax.")?;
let wdata = if self.use_webpage {
pw.get_artwork(id).await.ok_or("Failed to get artwork.")?["illust"]
[format!("{}", id)]
.clone()
} else {
pw.get_artwork_ajax(id)
.await
.ok_or("Failed to get artwork ajax.")?
};
self.data.set_web_data(id, wdata.clone());
wdata
}