Skip to content

fix: recover cleanly from failed Elementum playback resolution - #208

Draft
Therand90 wants to merge 3 commits into
Sam-Max:mainfrom
Therand90:fix/elementum-skip-file-dialog
Draft

fix: recover cleanly from failed Elementum playback resolution#208
Therand90 wants to merge 3 commits into
Sam-Max:mainfrom
Therand90:fix/elementum-skip-file-dialog

Conversation

@Therand90

Copy link
Copy Markdown
Contributor

Summary

Improve Jacktook's Elementum playback flow when automatic file resolution fails or playback is cancelled.

For TV playback, Jacktook now asks Elementum to keep its automatic file matching behavior but avoid falling back to the manual file picker when no automatic match is found.

Jacktook also tracks Elementum playback resolution through a per-playback token so a failed or cancelled resolution can return cleanly to SourceSelect instead of closing the parent source list.

If the first playback attempt from the same SourceSelect has already consumed Kodi's plugin resolution handle, subsequent attempts use an explicit Player.play() handoff instead of trying to reuse the stale setResolvedUrl() handle.

Dependencies

This PR depends on two upstream Elementum changes:

This PR is intentionally opened as a draft until those Elementum changes are available upstream.

Behavior

TV Elementum URLs include show / season / episode metadata and request skip_file_dialog=true when those values are valid.

Each Elementum playback attempt receives a unique resolution_token. A failed or cancelled Elementum resolution is detected without coupling Elementum to Jacktook-specific property names.

SourceSelect stays open after failed resolution and can retry another source. The first attempt uses Kodi's pending plugin-resolution handle; later attempts from the same SourceSelect use an explicit playback handoff because the original handle has already been consumed.

The SourceSelect resolving state is cleared on failure, and the background no longer fades out while a source is being resolved.

Movie playback keeps the existing Elementum filename-matching behavior.

Testing

  • 15 targeted regression tests pass
  • full pytest suite passes
  • git diff --check passes

Runtime-tested on Kodi / LibreELEC with:

  • a multi-file TV pack where the requested episode is missing
  • repeated retries of the same failed source
  • selecting another source after a failed resolution
  • cancelling Elementum movie playback during buffering
  • normal successful Elementum playback

In all tested failure/cancellation cases, playback returns cleanly to SourceSelect and the source list remains usable.

Add strict Elementum episode selection for TV metadata, propagate failed/cancelled resolution back to Jacktook, preserve SourceSelect after resolver failure, and use explicit Player.play() for retries after Kodi's original plugin resolution handle has been consumed.

Also keep SourceSelect visually intact while resolving and cover the failure/recovery paths with unit tests.

Runtime validated on Kodi with repeated selection of an Elementum season pack missing the requested episode.
Replace the Jacktook-specific Elementum resolution session contract with a generic resolution_token query parameter and plugin.video.elementum.resolution_status.<token> property.

Runtime validated with repeated failed episode resolution and manual movie buffering cancellation.
Generalize the explicit playback handoff logging and add regression tests covering Kodi handle consumption.

The tests verify that the first SourceSelect playback attempt uses the pending setResolvedUrl handle while retries switch to Player.play(), avoiding reuse of an already-consumed Kodi plugin resolution.
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.

1 participant