v0.30.0: OnlineSource forwards the disc title to the key service
OnlineSource::query() now includes the disc's volume_label (UDF/ISO volume id) as a plain-text `title` field in the /decode POST, so the key service can build a disc_hash → title catalog from real rips. Depends on libfreemkv 0.30.
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "freemkv-keysources"
|
||||
version = "0.29.0"
|
||||
version = "0.30.0"
|
||||
edition = "2024"
|
||||
license = "AGPL-3.0-only"
|
||||
description = "Pluggable AACS key sources (keydb, online key service, mapfile) for libfreemkv. Each source looks a disc up and hands libfreemkv a Key; the library does all derivation."
|
||||
@@ -10,7 +10,7 @@ categories = ["multimedia"]
|
||||
|
||||
[dependencies]
|
||||
# The crate provides the `KeySource` trait + `Key`/`DiscInputs` types these impls fill.
|
||||
libfreemkv = "0.29"
|
||||
libfreemkv = "0.30"
|
||||
# OnlineSource: POST disc inputs + samples to a key service over HTTP.
|
||||
ureq = { version = "2", features = ["json"] }
|
||||
serde_json = "1"
|
||||
|
||||
@@ -127,6 +127,7 @@ mod tests {
|
||||
mkb: Vec::new(),
|
||||
unit_key_ro: Vec::new(),
|
||||
samples: Vec::new(),
|
||||
volume_label: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,13 @@ impl OnlineSource {
|
||||
.collect(),
|
||||
);
|
||||
}
|
||||
// The disc's own title (UDF/ISO volume id), plain text. The key service
|
||||
// catalogs it by disc_hash (its disc-titles.json) — independent of keydb.
|
||||
if let Some(label) = inputs.volume_label.as_deref().map(str::trim) {
|
||||
if !label.is_empty() {
|
||||
body["title"] = serde_json::Value::String(label.to_string());
|
||||
}
|
||||
}
|
||||
let mut req = ureq::post(&self.base_url).timeout(Duration::from_secs(TIMEOUT_SECS));
|
||||
if !self.secret.is_empty() {
|
||||
req = req.set("Authorization", &format!("Bearer {}", self.secret));
|
||||
|
||||
Reference in New Issue
Block a user