Skip to content

Fix live search IDs and avoid direct-playing addon URLs#169

Open
0oAstro wants to merge 1 commit into
lostb1t:mainfrom
0oAstro:fix/live-search-canonical-proxy
Open

Fix live search IDs and avoid direct-playing addon URLs#169
0oAstro wants to merge 1 commit into
lostb1t:mainfrom
0oAstro:fix/live-search-canonical-proxy

Conversation

@0oAstro

@0oAstro 0oAstro commented May 19, 2026

Copy link
Copy Markdown

Summary

Fixes two related live-search/playback failure modes:

  • live search could return a synthetic Stremio/Gelato GUID even when the item was already materialized in Jellyfin, so opening /Items/{id} could 404
  • Gelato stream media sources were advertised as direct-playable HTTP URLs, which can leak internal addon/debrid proxy URLs to clients and make remote clients time out instead of proxying through Jellyfin

Changes

  • Prefer manager.FindExistingItem(baseItem) in SearchActionFilter.ConvertMetasToDtos and return the canonical item DTO when present.
  • Resolve user id from action/route arguments in addition to claims/query params so legacy/detail routes can pass through insert/sync filters correctly.
  • Include additional detail/playback/video/subtitle action names in insertable route detection.
  • Mark Gelato stream media sources as SupportsDirectPlay=false and stub URL paths in DTO/playback responses so clients use Jellyfin as the proxy instead of trying to open addon-internal URLs directly.

Local verification

Verified against a Jellyfin 10.11.x + Gelato 0.26.15.1 install:

  • Search matrix reloaded returned canonical Jellyfin item id instead of synthetic id.
  • Search timings remained sub-second to ~1.1s for tested queries.
  • /Users/{userId}/Items/{canonicalId} returned 200.
  • /Items/{canonicalId}/PlaybackInfo?UserId=... returned media source path /stub, Protocol=File, IsRemote=false, SupportsDirectPlay=false, SupportsDirectStream=true.
  • /Videos/{canonicalId}/stream.mkv?MediaSourceId={canonicalId}&Static=true returned HTTP 200 and started streaming via Jellyfin.

Closes #168.

//source.Path = "/stub";
//source.IsRemote = false;
// source.Protocol = MediaProtocol.File;
source.SupportsDirectPlay = false;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im hesitant on this. We dont know what clients ise this for. Maybe it will prevent them for direct playing at all wand a build a transcodee url themselves. If we just stub the path it should be enough

if (baseItem is null)
continue;

if (manager.FindExistingItem(baseItem) is { } existing)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is slow. I dont think its necessarily needed if the insert action catches all routes properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live search returns non-resolvable synthetic IDs and can expose internal stream URLs to clients

2 participants