fix(import): add decrypts_samples to ImportService

This commit is contained in:
imSp4rky
2026-10-16 09:12:02 -06:00
parent 71a0383258
commit ecb8296de8
2 changed files with 25 additions and 0 deletions
@@ -0,0 +1,19 @@
"""ImportService and RemoteService stand in for a Service in dl, so they have every method dl calls on one."""
from __future__ import annotations
import re
from pathlib import Path
import pytest
from unshackle.commands import dl as dl_module
from unshackle.core.import_service import ImportService
from unshackle.core.remote_service import RemoteService
@pytest.mark.parametrize("cls", [ImportService, RemoteService])
def test_stand_in_service_has_every_method_dl_calls(cls: type) -> None:
called = set(re.findall(r"\bservice\.(\w+)\(", Path(dl_module.__file__).read_text(encoding="utf-8")))
assert called
assert sorted(name for name in called if not hasattr(cls, name)) == []
+6
View File
@@ -765,6 +765,12 @@ class ImportService:
"license through a CDM: export the title again with the tracks you need selected."
)
def decrypts_samples(self, track: AnyTrack) -> bool:
return False
def get_sample_decrypter(self, track: AnyTrack, entry: int) -> bytes:
raise NotImplementedError("An import does not decrypt samples")
def on_segment_downloaded(self, track: AnyTrack, segment: Any) -> None:
pass