refactor(api): move the server CDM licence cap into one module that measures tracks by the -q rule

This commit is contained in:
imSp4rky
2026-11-29 09:16:18 -07:00
parent 6fc2d84bd7
commit 8e67081e11
13 changed files with 318 additions and 168 deletions
+3 -2
View File
@@ -82,6 +82,7 @@ from unshackle.core.remote_protocol import (
TrackKeys,
TracksReply,
TracksRequest,
cap_note,
coded,
)
from unshackle.core.search_result import SearchResult
@@ -1230,7 +1231,7 @@ class RemoteService(TitleSource):
self._server_cdm = server_cdm
if max_height is None:
return
message = f"The server CDM licenses up to {max_height}p for this API key"
message = cap_note(max_height)
if not server_cdm:
message += "; licensing with your own device"
elif self.local_cdm is not None:
@@ -1623,7 +1624,7 @@ class RemoteService(TitleSource):
)
cap = refusal.get("max_height")
if cap:
why = f"The server CDM licenses up to {cap}p for this API key"
why = cap_note(cap)
elif getattr(self, "_server_vault", False):
why = "The server vault holds no content key for this track"
else: