Files
script.service.ultimate/lib/streaming_providers/base/managers/__init__.py
T

65 lines
2.2 KiB
Python
Raw Normal View History

2026-10-03 14:35:57 +02:00
# streaming_providers/base/managers/__init__.py
"""
Manager ABCs for streaming providers.
2026-10-03 20:39:40 +02:00
Each manager wraps one capability area with a fixed public interface.
Providers subclass and implement the abstract methods; the concrete
methods (headers, DRM defaults, search no-ops) come for free.
2026-10-03 14:35:57 +02:00
Design rules
------------
* Constructors take four required collaborators -- http_manager, auth,
country, config -- plus keyword-only extras (caches, collaborators).
* Managers never hold a reference to the provider. Shared state is passed
in at construction.
* Managers raise from base.errors; nothing catches broadly.
* VOD navigation always returns VodPage (base/vod.py).
On the None-vs-exception rule
-----------------------------
2026-10-03 20:39:40 +02:00
Manager top-level methods signal "this manager doesn't handle that
content_id" by returning None / [] -- NOT by raising NotFoundError.
See providers/_template/README.md for the full rule.
2026-10-03 14:35:57 +02:00
Rigidity note
-------------
The ABCs enforce the *method names and signatures* through the abstract
method mechanism. They do NOT enforce that providers raise the right
error classes, or that they return the right content shapes. Those are
2026-10-03 20:39:40 +02:00
conventions documented in the template.
Manager list
------------
Three required capabilities:
ChannelManager
VodManager (providers without a browseable catalogue return None)
EpgManager (providers without EPG return None)
Four optional capabilities -- providers implement the ones they support:
RecordingsManager (cloud / network PVR)
FavoritesManager (user bookmarks on programs / channels)
BookmarksManager (resume position)
CatchupManager (timeshift / restart)
Providers signal a capability's presence by whether _build_*() returns
a manager or None. Capability flags (implements_vod, implements_epg,
implements_recordings, ...) are derived from that.
2026-10-03 14:35:57 +02:00
"""
from .channel import ChannelManager
from .vod import VodManager
from .epg import EpgManager
2026-10-03 20:39:40 +02:00
from .recordings import RecordingsManager
from .favorites import FavoritesManager
from .bookmarks import BookmarksManager
from .catchup import CatchupManager
2026-10-03 14:35:57 +02:00
2026-10-03 20:39:40 +02:00
__all__ = [
"ChannelManager",
"VodManager",
"EpgManager",
"RecordingsManager",
"FavoritesManager",
"BookmarksManager",
"CatchupManager",
]