fix(segments): read from the core endpoint so segments load again - #225
Merged
Conversation
Commit 3a3de4e pointed the segment read at Intro-Skipper's MediaSegmentsApi/{itemId} to escape the playback filtering that hides premiere intros. No released plugin serves a GET on that route. It is registered for POST and DELETE only, so ASP.NET answers 405 and the editor rendered "Something went wrong" instead of any segments. Read Jellyfin's core /MediaSegments/{itemId} again. That response is still shaped for playback, so premiere intros stay hidden until the unfiltered read lands as Phase 1 of docs/plans/plugin-api-integration.md, behind the Phase 0 capability probe. Probing the editor route first and falling back would have failed twice over. The implementation on the plugin's expand-segment-editor-workflows branch returns a bare array rather than the core { Items } envelope, so it parses as zero segments and hands batchSaveSegments an empty delete baseline, which recreates every segment as a duplicate. The mock server had served the editor GET, which is why local runs stayed green through the breakage. It now answers 405 like every released plugin. Fixes intro-skipper/segment-editor-plugin#17
Reviewer's GuideRestore segment reading to Jellyfin’s core /MediaSegments endpoint, harden segment parsing and error handling, and align the mock server and tests so the editor behavior matches real plugins (writes via MediaSegmentsApi, reads via core). File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by free · Input: 64.3K · Output: 22.7K · Cached: 627.1K |
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.
The editor loads no segments at all. It renders "Something went wrong" and DevTools shows the list query failing with 405 on
GET /MediaSegmentsApi/{itemId}. Reported in intro-skipper/segment-editor-plugin#17 against Jellyfin 10.11.11 with Intro Skipper 1.10.11.22.Commit 3a3de4e moved the read to that route to escape the playback filtering that hides premiere intros. No released plugin serves a GET there.
SegmentEditorControllerregisters the route for POST and DELETE only, so the path matches but the verb does not and ASP.NET answers 405. Writes were unaffected, which is why saving still worked.What this does
Reads Jellyfin's core
/MediaSegments/{itemId}again. That response is still shaped for playback, so premiere intros stay hidden until the unfiltered read arrives as Phase 1 ofdocs/plans/plugin-api-integration.md, behind the Phase 0 capability probe.I did not add a probe-and-fallback, because it would have failed twice over. The editor read implemented on the plugin's
expand-segment-editor-workflowsbranch returns a bare array, not the core{ Items }envelope. Parsing it as{ Items }yields zero segments, caches itself as working, and handsbatchSaveSegmentsan empty delete baseline, so every save recreates the segments as duplicates with no error shown.tools/server.mjsnow answers 405 on that route like every released plugin. It had been serving the editor GET, which is why local runs stayed green while every user was broken. Phase 0 adds theMOCK_EDITOR_APIswitch that lets the mock serve the real editor shape.Tests
The previous test asserted the URL the code itself built, so it agreed with the code no matter which endpoint it pointed at. Replaced with four cases: the core endpoint and auth header, a two-segment payload asserting order and tick conversion on both elements, an absent
Itemsarray, and a 500 that propagates rather than reporting an empty list.704 tests across 84 files pass.
tsc --noEmit,oxlintandoxfmt --checkare clean.Fixes intro-skipper/segment-editor-plugin#17
Summary by Sourcery
Restore editor segment reads by using the supported Jellyfin core endpoint and align the mock server and tests with production behavior.
Bug Fixes:
Enhancements:
Tests: