feat(trailers): let a user choose where trailers come from - #672
Open
IbbyLabs wants to merge 1 commit into
Open
Conversation
Contributor
PR Guard
Maintainers may still close PRs that do not match project direction or review capacity. |
IbbyLabs
force-pushed
the
feat/trailer-provider
branch
3 times, most recently
from
August 20, 2026 16:31
3ae09e9 to
5ec44bb
Compare
IbbyLabs
force-pushed
the
feat/trailer-provider
branch
from
August 20, 2026 16:45
5ec44bb to
2ee7da5
Compare
IbbyLabs
marked this pull request as draft
August 20, 2026 16:47
IbbyLabs
marked this pull request as ready for review
August 20, 2026 17:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets a user point trailers at any Stremio addon that returns a YouTube id, instead of taking whatever the metadata provider supplies.
streailerandcustomare the same code path; the preset only points at where to get the URL. It deliberately does not prefill one: an unconfigured Streailer URL returns that addon's own default language, so filling it in would hand the user a working-looking setting they never chose.If you would rather not name a third-party service in the settings page, delete the
streailerentry fromtrailerProviders. The custom option carries the feature without it.Linked issue
Closes #669
Type of change
Why this approach
A Stremio addon's manifest URL already carries that addon's own configuration, so its language setting travels with the URL the user pastes. Nothing here builds a config, which matters: Streailer answers a wrongly-shaped config path with 200 and its default language, so a URL assembled by this addon could ignore the setting without ever failing.
Taking a URL rather than a named provider list means the next trailer addon needs no code change. The stream endpoint is derived from the manifest URL by string swap, and a URL not ending in
/manifest.jsonis refused rather than guessed at.Applied once in
getMetarather than per builder, since trailer source is a user preference rather than a property of whichever provider answered. A failed or empty lookup leaves the provider's own trailers in place.The same boundary fills
trailerStreamsfor every provider when a builder left it empty. Stremio's meta object carries trailers in two fields and nothing here filled that one; Cinemeta emits both.getCache.tscarries the field in the trailers component so it survives a rebuild from cache.This changes what existing users see. Anyone with another metadata addon installed has been getting that addon's trailers for titles this one also has; they will now get these. That is the intent, but it is a behaviour change rather than a new setting they opted into.
Modelled on the existing
posterRatingProviderfor the type declaration, the context default and the search-index entry, and on the movie and series selects in the same file for theSettingRow+ProviderSelectpair.Testing
An addon returns 200 with an empty
streamsarray for a title it does not know, not a 404. That was checked against a live instance, and it is why the guard is on the number of usable ids rather than onres.ok— keying on the status alone would replace good trailers with an empty list on every unknown title.stream/<type>/<id>.json/manifest.jsontsc --noEmitis clean across the repo.Tested on a live instance running this branch: selecting a trailer addon and
pasting its manifest URL returns that addon's trailers, and leaving the setting on
defaultleaves the metadata provider's own trailers untouched.A multi-arch preview image of this exact commit:
The repository has no test suite or test script, so there was nothing to run or extend. What was exercised is described above.
Documentation
The setting is self-describing in the configure UI, and the addon URL field says where to configure the addon's own language.
Author checklist
CONTRIBUTING.md.AI usage disclosure