mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 16:05:06 +00:00
refactor(api): move the server CDM licence cap into one module that measures tracks by the -q rule
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user