fix(backend): proper types for yt-dlp metadata
This commit is contained in:
parent
29fe6d8864
commit
e027e399e5
1 changed files with 7 additions and 1 deletions
8
cli/src/extractors/external/ytdlp.rs
vendored
8
cli/src/extractors/external/ytdlp.rs
vendored
|
@ -137,7 +137,13 @@ impl Extractor for YtDlpExtractor {
|
|||
Entry {
|
||||
entity: address.clone(),
|
||||
attribute: attribute.clone(),
|
||||
value: EntryValue::guess_from(value.to_string()),
|
||||
value: match value {
|
||||
serde_json::Value::String(s) => s.clone().into(),
|
||||
serde_json::Value::Number(n) => n
|
||||
.as_f64()
|
||||
.map_or_else(|| n.to_string().into(), |f| f.into()),
|
||||
_ => value.to_string().into(),
|
||||
},
|
||||
provenance: context.provenance.clone() + "EXTRACTOR yt-dlp",
|
||||
user: context.user.clone(),
|
||||
timestamp: chrono::Utc::now().naive_utc(),
|
||||
|
|
Loading…
Reference in a new issue