mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-07-08 01:32:41 +08:00
Update
This commit is contained in:
@@ -13,21 +13,61 @@ pub struct FanboxPostArticle {
|
||||
}
|
||||
|
||||
impl FanboxPostArticle {
|
||||
#[inline]
|
||||
pub fn comment_count(&self) -> Option<u64> {
|
||||
self.data["commentCount"].as_u64()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn cover_image_url(&self) -> Option<&str> {
|
||||
self.data["coverImageUrl"].as_str()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn creator_id(&self) -> Option<&str> {
|
||||
self.data["creatorId"].as_str()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn excerpt(&self) -> Option<&str> {
|
||||
self.data["excerpt"].as_str()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn fee_required(&self) -> Option<u64> {
|
||||
self.data["feeRequired"].as_u64()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn has_adult_content(&self) -> Option<bool> {
|
||||
self.data["hasAdultContent"].as_bool()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn id(&self) -> Option<u64> {
|
||||
parse_u64(&self.data["id"])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn image_for_share(&self) -> Option<&str> {
|
||||
self.data["imageForShare"].as_str()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_liked(&self) -> Option<bool> {
|
||||
self.data["isLiked"].as_bool()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_restricted(&self) -> Option<bool> {
|
||||
self.data["isRestricted"].as_bool()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn like_count(&self) -> Option<u64> {
|
||||
self.data["likeCount"].as_u64()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Create a new instance
|
||||
pub fn new(data: &JsonValue, client: Arc<FanboxClientInternal>) -> Self {
|
||||
@@ -51,17 +91,43 @@ impl FanboxPostArticle {
|
||||
pub fn updated_datetime(&self) -> Option<&str> {
|
||||
self.data["updatedDatetime"].as_str()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn user_icon_url(&self) -> Option<&str> {
|
||||
self.data["user"]["iconUrl"].as_str()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn user_id(&self) -> Option<u64> {
|
||||
parse_u64(&self.data["user"]["userId"])
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn user_name(&self) -> Option<&str> {
|
||||
self.data["user"]["name"].as_str()
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for FanboxPostArticle {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("FanboxPostArticle")
|
||||
.field("id", &self.id())
|
||||
.field("comment_count", &self.comment_count())
|
||||
.field("cover_image_url", &self.cover_image_url())
|
||||
.field("creator_id", &self.creator_id())
|
||||
.field("excerpt", &self.excerpt())
|
||||
.field("fee_required", &self.fee_required())
|
||||
.field("has_adult_content", &self.has_adult_content())
|
||||
.field("image_for_share", &self.image_for_share())
|
||||
.field("is_liked", &self.is_liked())
|
||||
.field("is_restricted", &self.is_restricted())
|
||||
.field("like_count", &self.like_count())
|
||||
.field("published_datetime", &self.published_datetime())
|
||||
.field("title", &self.title())
|
||||
.field("updated_datetime", &self.updated_datetime())
|
||||
.field("user_icon_url", &self.user_icon_url())
|
||||
.field("user_id", &self.user_id())
|
||||
.field("user_name", &self.user_name())
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user