fix(api): make hlsUrl optional, and finish what v21 starts - #2004
Open
johan-bell wants to merge 1 commit into
Open
fix(api): make hlsUrl optional, and finish what v21 starts#2004johan-bell wants to merge 1 commit into
johan-bell wants to merge 1 commit into
Conversation
Two defects from the epic review, split out from the audio removal so each is reviewable on its own. Media is optional on a content parent, and a URL is optional within it: a document can name a bucket before an encode has produced anything, so hlsUrl is @IsOptional() again. The one thing the required URL had bought — refusing a key with nothing to decrypt — moves into processMedia, which drops the key with a warning rather than writing a sidecar no player will ever ask for. v21 copies legacy Content.video onto parent.media.hlsUrl but named no bucket. A URL inside a configured bucket then failed its next ordinary save with "Bucket is not specified", and the CMS hides the selector when a single bucket exists, so there was no way out. It now sets mediaBucketId when the URL lies under a bucket's publicUrl. v21 also deleted `video` from the children without stamping the parent's media onto them. The app plays from the child's parentMedia mirror and only a parent save refreshes it, so after the upgrade a migrated post had neither field to play from. Every translation of a touched parent now receives parentMedia and parentMediaBucketId. Also drops the stray root package-lock.json left beside the package.json #1991 removed.
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 two review blockers, split out of #1998 so each is reviewable on its own. API only.
1.
mediaoptional on the parent,hlsUrloptional within itA document can name a bucket before an encode has produced anything, so
hlsUrlis@IsOptional()again — as it is onmain. Making it required also meant a legacy audio-only post (media with no HLS collection) failed validation outright and could be neither saved nor deleted.The one thing the required URL had bought — refusing a key with nothing to decrypt — moves into
processMedia, which drops the key with a warning rather than writing a sidecar no player will ever ask for. That is a better place for the rule anyway: it can say why.2. v21 stranded migrated posts, two ways
v21 moves legacy
Content.videoontoparent.media.hlsUrl. It did so:publicUrlfailed its next ordinary save with "Bucket is not specified for media processing", andMediaBucketSelecthides the selector when only one bucket exists, leaving no way out short of re-encoding. It now setsmediaBucketIdwhen the URL matches a bucket; external URLs (YouTube, another CDN) stay bucket-less.parentMedia— it deletedchild.videobut left the mirror the app actually reads (parentMedia.hlsUrl || video) untouched, and only a parent save refreshes that. So a migrated post had neither field to play from until someone happened to re-save it. Every translation of a touched parent now receivesparentMediaandparentMediaBucketId— not only those that carried a video.Also
Drops the stray root
package-lock.json, sibling of thepackage.json#1991 removed.Tests
v21.spec: bucket named for an in-bucket URL, left unset for a YouTube link, media stamped onto every translation.processMediaDto.spec: a key with no URL is dropped and warned, writing no sidecar.validateChangeRequest.spec: media with no playlist URL validates.986 api tests pass,
tscclean — verified with this branch alone on the epic.Relationship to #1998
They overlap on one line of
v21.ts(parent.media = { fileCollections: [] }vs{}); whichever merges second needs a one-line resolution. The DTO drift is only fully closed when both are in: this PR makeshlsUrloptional, #1998 removesfileCollectionsfromsharedso the API and the client agree again.