Pre-clean stl_subtitle metadata before sidecar imports; import corrected subs as real language shapes - #505
Open
KillerX wants to merge 1 commit into
Open
Pre-clean stl_subtitle metadata before sidecar imports; import corrected subs as real language shapes#505KillerX wants to merge 1 commit into
KillerX wants to merge 1 commit into
Conversation
…ted subs as real language shapes Vidispine sidecar subtitle imports fail with "ambiguous path to group: stl_subtitle" when the item already carries stale instances of the group from earlier imports. Remove them first, addressed by group uuid per timespan, since addressing by name hits the same ambiguity. Corrected subtitles submitted through ImportSubtitles previously landed only as Transcribed_Subtitle_SRT, which exports treat as the AI "und" fallback gated behind SubsAllowAI. Import them additionally as sub_<iso>_srt (sub_nor_srt for "no") so exports pick them up as genuine subtitles for that language. Sidecar and shape import jobs are now awaited instead of having their results discarded, so a failed Vidispine job fails the workflow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
stl_subtitlemetadata group during sidecar import, and the group name resolves to more than one path when the item already carries multiple/stale instances from earlier imports.ImportSubtitles) landed only as shapeTranscribed_Subtitle_SRT, which exports treat as the AI-generatedundfallback gated behindSubsAllowAI— instead of as real Norwegian subtitles.Changes
Pre-clean before sidecar import
GetMetadataGroupInstances/DeleteMetadataGroupInstances: list every occurrence of a named metadata group across the item's timespans (nested groups included) and remove them viaPUT /item/{id}/metadatawith<group uuid="..." mode="remove"/>— addressed by uuid, since addressing by name is exactly what Vidispine rejects as ambiguous.DeleteMetadataGroupInstancesActivity(auto-registered via the worker's reflection loop) and constantvscommon.GroupStlSubtitle.ImportSubtitles,ImportSidecarSubtitle(TranscribeVX's detached child), andImportSubtitlesFromSubtrans— in the last one once before the multi-language loop, so one language's import doesn't wipe the previous one's cues.Corrected subs as real language shapes
ImportSubtitlesparsesinput.Languageup front (acceptsnoornor) and imports the corrected SRT as a third shapesub_<iso>_srt(sub_nor_srtfor Norwegian), alongside the existingTranscribed_Subtitle_SRT/transcription_jsonshapes other consumers rely on. Exports key real subtitles offsub_<iso>_srt, so corrected subs surface as genuinenorsubs withoutSubsAllowAI.Fail loudly
ImportSubtitlesnow waits for the sidecar Vidispine job to complete.import_subs.gono longer discards job-wait results with_ =; a failed shape or sidecar job fails the workflow with the language in the error.Tests
MetadataListDocumentand bare-document envelopes, nested groups).ImportSubtitlessuite: asserts all three shape tags and the pre-clean; new sidecar-job-failure path.ImportSubtitlesFromSubtranssuite: cleanup runs exactly once across two languages; a failing sidecar job fails the workflow.Staging verification
The exact JSON envelope of
GET /item/{id}/metadata?group=...should be confirmed against a real item — the parser accepts both shapes, but check the first run'sDeletedInstancesmatches expectations, then confirm a previously failing VXID imports cleanly and a VOD export yieldsnorsubs withoutSubsAllowAI.🤖 Generated with Claude Code