adapters

package
v0.3.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: GPL-3.0 Imports: 57 Imported by: 0

Documentation

Overview

Package adapters bridges runtime plugin contributions (WS9a list sources and WS9c Live TV channel sources) into Ether's collection, personalization and Live TV registries.

Package adapters bridges installed Ether plugins (internal/plugins) into the core media, catalogue, live TV, subtitle, marker, notification and ranking interfaces (SPEC §5.1.3, WS9).

Index

Constants

View Source
const (
	MaxKindExpandPages = 20
	MaxKindExpandItems = 2000
)
View Source
const DefaultPluginListItems = 500

DefaultPluginListItems bounds an unbounded list refresh per run so multi-thousand-item Stremio/MDBList catalogues page incrementally without exhausting runtime timeouts.

View Source
const MaxPluginListItems = stremio.MaxCatalogItems

MaxPluginListItems bounds the maximum items an explicit source config may request.

Variables

This section is empty.

Functions

func AttachDebrid

func AttachDebrid(mgr *plugins.Manager, svc *debrid.Service)

AttachDebrid registers native plugin providers without copying their sealed credentials into server configuration. Disable/remove immediately unregisters.

func AttachMetadata

func AttachMetadata(mgr *plugins.Manager, registry metadataRegistry)

AttachMetadata makes both native and adapted providers use the catalogue's shared registration, identity checks, persistence and materialization policy.

func AttachSubtitles

func AttachSubtitles(mgr *plugins.Manager, svc *subtitles.Service)

func ExpandAddonIndexers

func ExpandAddonIndexers(ctx context.Context, mgr *plugins.Manager, rows []config.Indexer) []config.Indexer

ExpandAddonIndexers is the indexer list the running search manager searches: the owner's rows, then one row per installed plugin that serves streams (an Ether source plugin, or a Stremio add-on installed from Plugins with its streams on). Plugin rows are never saved: the plugin is their configuration, and the Indexers page stays the owner's own list.

func IsLocalPayload

func IsLocalPayload(b []byte) bool

IsLocalPayload reports whether b is an encoded LocalPayload.

func ResolveKindMediaClass

func ResolveKindMediaClass(decl plugins.MediaKindMeta, present core.Presentations) core.MediaClass

ResolveKindMediaClass derives the effective MediaClass for a declared kind via the shared presentation resolver (MediaKindMeta.Media, KindLevel.Role, presentation metadata, and level shape).

Types

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

Bridge tracks the source kinds registered for each plugin so enable, disable, update and uninstall cleanly replace or remove them.

func Attach

func Attach(mgr *plugins.Manager, cols *collections.Service, pers *personalize.Engine, tv *livetv.Service) *Bridge

Attach wires plugin list sources (collections + Home rows) and Live TV channel sources to the plugin manager's lifecycle.

func (*Bridge) Sync

func (b *Bridge) Sync(_ context.Context, r plugins.Record)

Sync updates all adapter registrations for one plugin record.

type DebridSourceBackend

type DebridSourceBackend interface {
	CheckCached(ctx context.Context, hashes []string) (map[string]bool, bool)
	Acquire(ctx context.Context, rel core.Release) ([]byte, error)
	ListReleaseFiles(ctx context.Context, rel core.Release) ([]core.ReleaseFile, error)
}

DebridSourceBackend is the subset of debrid.Service used by KindResolver for host-mediated debrid cache checks and torrent acquisition.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine wraps an inner core.Engine (and core.ReleaseHealthChecker) so ETHER-LOCAL/1 payloads open granted local files directly via os.Open and satisfy core.LocalFileSource.

func (*Engine) Check

func (e *Engine) Check(ctx context.Context, payload []byte) (bool, error)

Check implements core.HealthChecker.

func (*Engine) CheckArticles

func (e *Engine) CheckArticles(ctx context.Context, releaseID string, nzbData []byte) (core.UsenetCheckResult, error)

CheckArticles forwards bounded Usenet article availability checks to the wrapped streaming engine.

func (*Engine) CheckRelease

func (e *Engine) CheckRelease(ctx context.Context, releaseID string, payload []byte) (bool, error)

CheckRelease implements core.ReleaseHealthChecker.

func (*Engine) ListFiles

func (e *Engine) ListFiles(ctx context.Context, releaseID string, nzbData []byte) ([]core.ReleaseFile, error)

ListFiles forwards NZB release file listing (exact decoded sizes via PAR2/yEnc when available) to the wrapped streaming engine.

func (*Engine) Open

func (e *Engine) Open(ctx context.Context, releaseID string, payload []byte) (core.MediaSource, error)

Open implements core.Engine.

func (*Engine) Prefetch

func (e *Engine) Prefetch(ctx context.Context, releaseID string, payload []byte, offset, length int64) error

Prefetch implements core.Engine.

type KindCatalog

type KindCatalog struct {
	// contains filtered or unexported fields
}

KindCatalog bridges plugin media-kind declarations and lifecycle events to the libraries, pluginitems and blobcache stores, and implements experience.PluginLibraries so client surfaces read exclusively from the local store on browse, detail, children and facet paths.

func AttachKindCatalog

func AttachKindCatalog(syncCtx context.Context, deps KindCatalogDeps) *KindCatalog

AttachKindCatalog constructs a KindCatalog and registers its OnSync and OnRemove lifecycle hooks on deps.Manager. Call before Manager.Start so already-installed kind plugins are reconciled on startup.

func (*KindCatalog) Ancestors

func (c *KindCatalog) Ancestors(ctx context.Context, key core.RatingKey) ([]core.Title, core.Library, error)

Ancestors implements experience.PluginLibraries, returning ancestors ordered from root to immediate parent.

func (*KindCatalog) Browse

Browse implements experience.PluginLibraries. It reads strictly from the pluginitems store and never invokes the plugin runtime.

func (*KindCatalog) Children

func (c *KindCatalog) Children(ctx context.Context, parent core.RatingKey, recursive bool, cursor string, limit int) (experience.PluginBrowsePage, error)

Children implements experience.PluginLibraries.

func (*KindCatalog) Count

func (c *KindCatalog) Count(ctx context.Context, lib core.Library) (int, error)

Count implements experience.PluginLibraries.

func (*KindCatalog) FacetBuckets

func (c *KindCatalog) FacetBuckets(ctx context.Context, lib core.Library, field string) ([]frontend.FacetBucket, error)

FacetBuckets implements experience.PluginPresentationLibraries.

func (*KindCatalog) FacetBucketsAtLevel

func (c *KindCatalog) FacetBucketsAtLevel(ctx context.Context, lib core.Library, level, field string) ([]frontend.FacetBucket, error)

FacetBucketsAtLevel implements experience.PluginLevelFacetLibraries.

func (*KindCatalog) FacetCollections

func (c *KindCatalog) FacetCollections(ctx context.Context, lib core.Library, field, order, query string, offset, limit int) (frontend.FacetCollectionPage, error)

FacetCollections implements experience.PluginPresentationLibraries.

func (*KindCatalog) FacetCollectionsAtLevel

func (c *KindCatalog) FacetCollectionsAtLevel(ctx context.Context, lib core.Library, level, field, order, query string, offset, limit int) (frontend.FacetCollectionPage, error)

FacetCollectionsAtLevel implements experience.PluginLevelFacetLibraries.

func (*KindCatalog) FacetPeople

func (c *KindCatalog) FacetPeople(ctx context.Context, lib core.Library, field, order, query string, offset, limit int) (experience.PluginFacetPeoplePage, error)

FacetPeople implements experience.PluginPresentationLibraries.

func (*KindCatalog) FacetPeopleAtLevel

func (c *KindCatalog) FacetPeopleAtLevel(ctx context.Context, lib core.Library, level, field, order, query string, offset, limit int) (experience.PluginFacetPeoplePage, error)

FacetPeopleAtLevel implements experience.PluginLevelFacetLibraries.

func (*KindCatalog) Facets

func (c *KindCatalog) Facets(ctx context.Context, lib core.Library, facet string) ([]core.FacetValue, error)

Facets implements experience.PluginLibraries.

func (*KindCatalog) FacetsAtLevel

func (c *KindCatalog) FacetsAtLevel(ctx context.Context, lib core.Library, level, facet string) ([]core.FacetValue, error)

FacetsAtLevel implements experience.PluginLevelFacetLibraries. level may be empty (defaults to the kind's root level), an exact declared level key, or a protocol item type/role (for example "album", "track", "MusicAlbum", "Audio").

func (*KindCatalog) FindPersonID

func (c *KindCatalog) FindPersonID(ctx context.Context, lib core.Library, match func(personID int64, name string) bool) (int64, bool, error)

FindPersonID implements experience.PluginPeopleLibraries.

func (*KindCatalog) IsPluginLibraryActive

func (c *KindCatalog) IsPluginLibraryActive(ctx context.Context, lib core.Library) bool

IsPluginLibraryActive reports whether lib's owning plugin is installed, enabled, has catalog_provider active (not disabled via RolesOff), declares a library for KindKey, and has no required setup blockers. Runtime crash state intentionally does NOT hide the library so synced items remain browsable offline when a plugin fails at runtime.

func (*KindCatalog) Item

Item implements experience.PluginLibraries.

func (*KindCatalog) ItemsMany

ItemsMany implements experience.PluginLibraries using batched item, artwork, and visibility queries per library rather than one query per key.

func (*KindCatalog) Libraries

func (c *KindCatalog) Libraries(ctx context.Context) ([]core.Library, error)

Libraries implements experience.PluginLibraries.

func (*KindCatalog) Library

func (c *KindCatalog) Library(ctx context.Context, id core.LibraryID) (core.Library, error)

Library implements experience.PluginLibraries.

func (*KindCatalog) MaybeExpand

func (c *KindCatalog) MaybeExpand(ctx context.Context, lib core.Library, q frontend.ItemQuery) bool

MaybeExpand checks whether viewer browse query q opens a single declared expandable facet bucket or a plugin person's credits on lib. When no fresh expansion exists within ttlHours it launches one via Manager.StartExpandJob. The first page of the slice then waits (at most firstOpenWait) for the fill's first stored page, so the first open shows the newest titles. It reports whether it gave up before that page arrived; later pages never wait.

func (*KindCatalog) MemberOf

func (c *KindCatalog) MemberOf(ctx context.Context, lib core.Library, key core.RatingKey) (bool, error)

MemberOf implements experience.PluginLibraries for a collection library: it reports whether key is a shared member of the collection, one indexed read on collections_members, never a walk.

func (*KindCatalog) PersonByID

func (c *KindCatalog) PersonByID(ctx context.Context, lib core.Library, personID int64, itemLimit int) (experience.PluginPersonMatch, bool, error)

PersonByID implements experience.PluginPeopleLibraries.

func (*KindCatalog) Presentation

Presentation implements experience.PluginPresentationLibraries.

func (*KindCatalog) QuotaFor

func (c *KindCatalog) QuotaFor(pluginID, libraryKey string) blobcache.Quota

QuotaFor returns the declared blobcache quota for (pluginID, libraryKey), used by blobcache.Cache.HostBackends and KindResolver.

func (*KindCatalog) RefreshPlugin

func (c *KindCatalog) RefreshPlugin(ctx context.Context, r plugins.Record)

RefreshPlugin reconciles an explicitly restored library with current setup and enabled state, including restarting its background synchronization.

func (*KindCatalog) RootMediaType

func (c *KindCatalog) RootMediaType(ctx context.Context, lib core.Library) core.MediaType

RootMediaType implements experience.PluginLibraries.

func (*KindCatalog) Search

func (c *KindCatalog) Search(ctx context.Context, lib core.Library, query string, q frontend.ItemQuery, limit int) ([]core.Title, error)

Search implements experience.PluginLibraries: local FTS5/tsvector search plus optional 2-second bounded live plugin search with background upsert (§15.4).

func (*KindCatalog) SearchPeople

func (c *KindCatalog) SearchPeople(ctx context.Context, lib core.Library, query string, q frontend.ItemQuery, personLimit, itemLimit int) ([]experience.PluginPersonMatch, error)

SearchPeople implements experience.PluginPeopleLibraries.

func (*KindCatalog) SkipResume

func (c *KindCatalog) SkipResume(ctx context.Context, key core.RatingKey) bool

SkipResume reports whether playback progress for key must not persist a resume offset (music libraries and track-role items). LastViewedAt and completion tracking continue normally so history shelves work.

type KindCatalogDeps

type KindCatalogDeps struct {
	TitleInLibrary func(context.Context, core.Library, core.RatingKey) (bool, error)

	Manager           *plugins.Manager
	Libraries         *libraries.Service
	Items             *pluginitems.Service
	Blobs             *blobcache.Cache
	BlobDir           string
	Logger            *slog.Logger
	LiveSearchTimeout time.Duration
}

KindCatalogDeps configures a KindCatalog adapter.

type KindResolver

type KindResolver struct {
	// contains filtered or unexported fields
}

KindResolver implements frontend.KindStreams and frontend.KindPartStreams for plugin content kinds and supplies the host-side ResolveSources callback for plugins.KindBackends.

func NewKindResolver

func NewKindResolver(deps KindResolverDeps) *KindResolver

NewKindResolver constructs a KindResolver.

func (*KindResolver) InvalidatePlugin

func (r *KindResolver) InvalidatePlugin(pluginID string)

InvalidatePlugin cancels any in-flight resolves tied to pluginID's previous runtime and evicts its in-memory candidate cache so disabling/re-enabling or reloading a plugin starts from a clean slate.

func (*KindResolver) KeyForRef

func (r *KindResolver) KeyForRef(ctx context.Context, viewer *core.Viewer, ref core.ItemRef) (core.RatingKey, error)

KeyForRef implements frontend.KindRefKeys. It maps a plugin ItemRef to the stored item's RatingKey, refusing hidden libraries and viewers who cannot open them.

func (*KindResolver) KindLeaves

func (r *KindResolver) KindLeaves(ctx context.Context, viewer *core.Viewer, parent core.RatingKey) ([]frontend.KindLeaf, error)

KindLeaves implements frontend.KindStreams.

func (*KindResolver) KindParts

func (r *KindResolver) KindParts(ctx context.Context, viewer *core.Viewer, key core.RatingKey) ([]frontend.KindPart, error)

KindParts implements frontend.KindPartStreams (#576). It returns the declared or resolve-time parts of item without opening bytes.

func (*KindResolver) KindVersions

func (r *KindResolver) KindVersions(ctx context.Context, viewer *core.Viewer, key core.RatingKey, accept []string, allowResolve bool) ([]core.ReleaseVariant, error)

KindVersions lists the playable version menu of a plugin kind item in the same W152 shape catalogue VersionSlots uses: index 0 is the synthetic Auto slot (backed by the viewer's remembered choice when matched, else the plugin's first source), followed by the remaining distinct /resolve sources. When allowResolve is false or ctx carries LocalResponse, only cached candidates are inspected and the plugin's /resolve endpoint is never called.

func (*KindResolver) OpenKind

func (r *KindResolver) OpenKind(ctx context.Context, viewer *core.Viewer, key core.RatingKey, accept []string) (*frontend.KindMedia, error)

OpenKind implements frontend.KindStreams.

func (*KindResolver) OpenKindExcluding

func (r *KindResolver) OpenKindExcluding(ctx context.Context, viewer *core.Viewer, key core.RatingKey, accept, exclude []string) (*frontend.KindMedia, error)

OpenKindExcluding opens a plugin kind item while excluding already-tried candidate release IDs (for mid-stream playback failover). Replacement candidates come from the stored candidate list of the same kind resolve, falling back to a fresh plugin re-resolve when exhausted or expired, and respecting provider backoff.

func (*KindResolver) OpenKindPart

func (r *KindResolver) OpenKindPart(ctx context.Context, viewer *core.Viewer, key core.RatingKey, partIndex int, accept []string) (*frontend.KindMedia, error)

OpenKindPart implements frontend.KindPartStreams (#576). It opens one zero-based part of a multi-part plugin kind item, passing KindResolveRequest.PartIndex to the plugin's /resolve route.

func (*KindResolver) OpenKindPartExcluding

func (r *KindResolver) OpenKindPartExcluding(ctx context.Context, viewer *core.Viewer, key core.RatingKey, partIndex int, accept, exclude []string) (*frontend.KindMedia, error)

OpenKindPartExcluding opens one zero-based part of a multi-part plugin kind item while skipping candidate release IDs listed in exclude.

func (*KindResolver) OpenKindPartSource

func (r *KindResolver) OpenKindPartSource(ctx context.Context, viewer *core.Viewer, key core.RatingKey, partIndex *int, sourceID string, accept []string) (*frontend.KindMedia, error)

OpenKindPartSource opens exactly one resolver source (and optional zero-based part) for a source-scoped frontend adapter stream ticket (#661). It passes KindResolveRequest.Source to /resolve, opens only the matching source via openSingleSource with no failover to other sources, and leaves the shared default winner and candidate caches untouched. A plugin that ignores KindResolveRequest.Source still works: Ether picks the source with the matching PlayableSource.ID from the response, or returns ErrNotAvailable if it is absent.

func (*KindResolver) OpenKindSource

func (r *KindResolver) OpenKindSource(ctx context.Context, viewer *core.Viewer, key core.RatingKey, sourceID string, accept []string) (*frontend.KindMedia, error)

OpenKindSource opens exactly one plugin kind source by its stable candidate release id (a version-slot pick) or PlayableSource.ID. It reuses the in-memory and persisted resolution candidate caches so a warm list does not re-run the plugin, opens only the matching candidate, and leaves the shared default winner untouched. A source id not among the current non-expired candidates returns ErrNotAvailable.

func (*KindResolver) RefsForKeys

func (r *KindResolver) RefsForKeys(ctx context.Context, viewer *core.Viewer, keys []core.RatingKey) (map[core.RatingKey]core.ItemRef, error)

RefsForKeys implements frontend.KindRefKeys. It returns the ItemRef of each key the viewer may see; unknown or unauthorized keys are omitted. The page is caller-bounded, so this is a handful of indexed reads, never a walk.

func (*KindResolver) ResolveSources

func (r *KindResolver) ResolveSources(ctx context.Context, _ string, q core.SourceQuery) ([]core.SourceCandidate, error)

ResolveSources implements plugins.KindBackends.ResolveSources for plugins granted permissions.sources ("search" or "acquire"). Capability and permission checks are enforced upstream in plugins/host_kinds.go.

type KindResolverDeps

type KindResolverDeps struct {
	Manager       *plugins.Manager
	Libraries     *libraries.Service
	Items         *pluginitems.Service
	Blobs         *blobcache.Cache
	Catalog       *KindCatalog
	Indexer       core.Indexer
	Resolver      *resolver.Service
	Debrid        DebridSourceBackend
	Engine        core.Engine
	UsenetServing func() bool
	Now           func() time.Time
	HTTP          *http.Client
	Authorize     func(ctx context.Context, viewer *core.Viewer, key core.RatingKey) error
	Logger        *slog.Logger
	// Optional release-open budget overrides (0 uses sensible production defaults).
	NZBFetchTimeout      time.Duration
	EngineOpenTimeout    time.Duration
	CandidateOpenTimeout time.Duration
}

KindResolverDeps configures a KindResolver.

type LocalPayload

type LocalPayload struct {
	PluginID  string `json:"pluginId"`
	ReleaseID string `json:"releaseId"`
	FilePath  string `json:"filePath"`
	Name      string `json:"name"`
	Size      int64  `json:"size"`
	Origin    string `json:"origin,omitempty"`
	Remote    bool   `json:"remote,omitempty"`
}

LocalPayload describes a local file stream authorized through a plugin's folders: read grant (SPEC §5.1.4). Permission and symlink containment are re-verified on every CheckRelease and Open call so revoking a folder grant takes effect immediately.

func DecodeLocalPayload

func DecodeLocalPayload(b []byte) (LocalPayload, error)

DecodeLocalPayload parses an encoded LocalPayload.

func (LocalPayload) Encode

func (p LocalPayload) Encode() []byte

Encode serializes p with the local payload prefix.

type MarkerBridge

type MarkerBridge struct {
	// contains filtered or unexported fields
}

func AttachMarkers

func AttachMarkers(ctx context.Context, mgr *plugins.Manager, svc *markers.Service, catalog core.Catalog, opts MarkerBridgeOptions) *MarkerBridge

func (*MarkerBridge) Schedule

func (b *MarkerBridge) Schedule(key core.RatingKey, d time.Duration) <-chan struct{}

Schedule queues work without contacting a plugin on the caller's path.

func (*MarkerBridge) Wait

func (b *MarkerBridge) Wait()

Wait waits for the background worker to stop after its context is cancelled.

type MarkerBridgeOptions

type MarkerBridgeOptions struct {
	// Selected reports whether a plugin source is in the owner's source order.
	Selected func(string) bool
	// SkipDB reports the built-in SkipDB source's live settings.
	SkipDB func() (enabled bool, apiKey, baseURL string)
}

MarkerBridgeOptions configure the built-in marker sources the bridge refreshes alongside plugin sources.

type Ranking

type Ranking struct {
	Manager  RankingManager
	Registry *extend.Registry
}

func (Ranking) NewResolve

func (a Ranking) NewResolve(ctx context.Context, caps core.ClientCaps) resolver.RankingSession

type RankingManager

type RankingManager interface {
	HotReady(string) (plugins.HotRuntime, bool)
	RecordRanking(context.Context, string, plugins.RankingReport)
}

Ranking bridges the resolver to installed hosted hot-path plugins.

type SourceStats

type SourceStats struct {
	PluginID string `json:"pluginId"`
	Name     string `json:"name"`
	Class    string `json:"class"`
	Searches int64  `json:"searches"`
	Grabs    int64  `json:"grabs"`
	Failures int64  `json:"failures"`
}

SourceStats reports per-plugin stream-source activity for the Sources -> Usage tab.

type StreamSources

type StreamSources struct {
	// contains filtered or unexported fields
}

StreamSources adapts enabled `stream_source` plugins into a core.Indexer (and core.StreamingIndexer / core.RescueIndexer) alongside an optional inner indexer (typically *newznab.Manager).

func NewStreamSources

func NewStreamSources(inner core.Indexer) *StreamSources

NewStreamSources constructs a StreamSources adapter wrapping inner.

func (*StreamSources) Backend

func (s *StreamSources) Backend(ix config.Indexer) (newznab.Backend, error)

Backend returns the search backend of an add-on indexer row (newznab.Options.Backend). Backends are kept per row so throttling state survives between searches.

func (*StreamSources) Bind

func (s *StreamSources) Bind(mgr *plugins.Manager, deb *debrid.Service)

Bind attaches the plugin manager and debrid service once they are built.

func (*StreamSources) FetchNZB

func (s *StreamSources) FetchNZB(ctx context.Context, r core.Release) ([]byte, error)

FetchNZB implements core.Indexer. An Ether plugin's lazy and local-file streams are opened here at play time (their GUID names the plugin and the stream); everything else is the inner indexer's.

func (*StreamSources) HasEnabledPlugins

func (s *StreamSources) HasEnabledPlugins(ctx context.Context) bool

HasEnabledPlugins reports whether at least one stream_source plugin is enabled.

func (*StreamSources) HasTorrentIndexer

func (s *StreamSources) HasTorrentIndexer() bool

HasTorrentIndexer implements the debrid sourceInventory contract.

func (*StreamSources) MissingSources

func (s *StreamSources) MissingSources() error

MissingSources implements the debrid/resolver sourceInventory contract.

func (*StreamSources) Name

func (s *StreamSources) Name() string

Name implements core.Indexer.

func (*StreamSources) Order

func (s *StreamSources) Order() []string

Order returns the current preferred plugin source order.

func (*StreamSources) ResolveTorrent

func (s *StreamSources) ResolveTorrent(ctx context.Context, r core.Release) (core.Release, error)

ResolveTorrent implements debrid.TorrentResolver.

func (*StreamSources) Search

func (s *StreamSources) Search(ctx context.Context, req core.SearchRequest) ([]core.Release, error)

Search implements core.Indexer.

func (*StreamSources) SearchRescue

func (s *StreamSources) SearchRescue(ctx context.Context, req core.SearchRequest) ([]core.Release, error)

SearchRescue implements core.RescueIndexer.

func (*StreamSources) SearchRescueWith

func (s *StreamSources) SearchRescueWith(ctx context.Context, req core.SearchRequest, arrived func([]core.Release)) ([]core.Release, error)

SearchRescueWith implements core.StreamingRescueIndexer.

func (*StreamSources) SearchWith

func (s *StreamSources) SearchWith(ctx context.Context, req core.SearchRequest, arrived func([]core.Release)) ([]core.Release, error)

SearchWith implements core.StreamingIndexer. Add-on streams are searched as indexer rows inside inner (see Backend).

func (*StreamSources) SetAnimeIDs

func (s *StreamSources) SetAnimeIDs(a stremio.AnimeIDs)

SetAnimeIDs wires the anime id mapping used for add-ons that look anime up by Kitsu, MAL, AniList or AniDB ids.

func (*StreamSources) SetClientIdentity

func (s *StreamSources) SetClientIdentity(fn func() config.ClientIdentity)

SetClientIdentity wires the server-wide request identity lookup used when downloading add-on NZBs.

func (*StreamSources) SetClock

func (s *StreamSources) SetClock(now func() time.Time)

SetClock overrides the clock used for rate-limit windows in tests.

func (*StreamSources) SetNZBClient

func (s *StreamSources) SetNZBClient(c *http.Client)

SetNZBClient overrides the client that downloads add-on NZBs (tests).

func (*StreamSources) SetOrder

func (s *StreamSources) SetOrder(ids []string)

SetOrder sets the preferred plugin source order (plugin IDs).

func (*StreamSources) SetSpecialEpisodes

func (s *StreamSources) SetSpecialEpisodes(mapper stremio.SpecialEpisodes)

SetSpecialEpisodes shares the injected IMDb specials mapper with installed add-ons. No mapper means specials with IMDb routes are skipped.

func (*StreamSources) SetUsenetReady

func (s *StreamSources) SetUsenetReady(fn func() bool)

SetUsenetReady wires the Usenet readiness check so non-plugin Usenet releases still require an enabled Usenet provider when plugin sources are active.

func (*StreamSources) Stats

func (s *StreamSources) Stats(ctx context.Context) []SourceStats

Stats returns per-plugin search and grab counters for enabled stream_source plugins.

func (*StreamSources) WrapEngine

func (s *StreamSources) WrapEngine(inner core.Engine) *Engine

WrapEngine wraps inner with local-file payload support backed by s.

type SubtitleProbe

type SubtitleProbe struct {
	// contains filtered or unexported fields
}

SubtitleProbe exercises the ordinary subtitle broker with one installed provider. Offers and explicit picks are isolated from viewer selections and production sidecars. Each session is single-use, bounded and cleaned up.

func NewSubtitleProbe

func NewSubtitleProbe(mgr *plugins.Manager, catalog probeCatalog) *SubtitleProbe

func (*SubtitleProbe) Close

func (p *SubtitleProbe) Close()

func (*SubtitleProbe) Handler

func (p *SubtitleProbe) Handler() http.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL