Skip to content

Commit ec626f8

Browse files
committed
[bilibili.space] JSON module_author.pub_ts is changed to string
1 parent db0c937 commit ec626f8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/platform/bilibili/source/space.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ mod data {
108108
impl ModuleAuthor {
109109
pub fn pub_time(&self) -> Option<u64> {
110110
let pub_ts = match self {
111-
ModuleAuthor::Normal(normal) => normal.pub_ts,
112-
ModuleAuthor::Pgc(pgc) => pgc.pub_ts,
113-
};
111+
ModuleAuthor::Normal(normal) => normal.pub_ts.as_str(),
112+
ModuleAuthor::Pgc(pgc) => pgc.pub_ts.as_str(),
113+
}
114+
.parse::<u64>()
115+
.ok()?;
114116
(pub_ts != 0).then_some(pub_ts)
115117
}
116118
}
@@ -137,15 +139,15 @@ mod data {
137139
pub face: String, // URL
138140
pub mid: StrOrNumber,
139141
pub name: String,
140-
pub pub_ts: u64,
142+
pub pub_ts: String,
141143
}
142144

143145
#[derive(Clone, Debug, Deserialize)]
144146
pub struct ModuleAuthorPgc {
145147
pub face: String, // URL
146148
pub mid: StrOrNumber,
147149
pub name: String,
148-
pub pub_ts: u64, // Always 0?
150+
pub pub_ts: String, // Always "0"?
149151
}
150152

151153
#[derive(Debug, Deserialize)]

0 commit comments

Comments
 (0)