mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-14 13:05:09 +00:00
fix(import): say an import uses the export's keys, not a server CDM
The CDM type stub now follows the exported DRM system.
This commit is contained in:
@@ -293,6 +293,17 @@ def test_import_with_no_usable_title_says_so(tmp_path: Path) -> None:
|
||||
ImportService(import_ctx(), "EXAMPLE", "movie-1", str(export))
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("system", "expected"), [("playready", "playready"), ("widevine", "widevine")])
|
||||
def test_import_takes_its_drm_type_from_the_export(tmp_path: Path, system: str, expected: str) -> None:
|
||||
"""The type stub routes the DRM objects, so it follows the exported system, not a widevine default."""
|
||||
export = crit_export(tmp_path / "export.json")
|
||||
doc = read_export(export)
|
||||
doc["titles"][0]["drm"] = [{"system": system, "pssh": "AAAA"}]
|
||||
export.write_text(json.dumps(doc), encoding="utf8")
|
||||
|
||||
assert ImportService(import_ctx(), "EXAMPLE", "movie-1", str(export))._server_cdm_type == expected
|
||||
|
||||
|
||||
class KeyDRM:
|
||||
"""A licensed DRM system that holds only ``content_keys``."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user