diff --git a/packages/common/src/schemas/upload/uploadFormSchema.ts b/packages/common/src/schemas/upload/uploadFormSchema.ts index 225baa74f88..5572681a4ce 100644 --- a/packages/common/src/schemas/upload/uploadFormSchema.ts +++ b/packages/common/src/schemas/upload/uploadFormSchema.ts @@ -73,7 +73,7 @@ const DDEXResourceContributor = z .object({ name: z.string(), roles: z.array(z.string()), - sequence_number: z.number().positive() + sequence_number: z.optional(z.number()) }) .strict() diff --git a/packages/ddex/ingester/parser/ern38x.go b/packages/ddex/ingester/parser/ern38x.go index 7b8bb8f7d2f..2fd48717c64 100644 --- a/packages/ddex/ingester/parser/ern38x.go +++ b/packages/ddex/ingester/parser/ern38x.go @@ -319,6 +319,13 @@ func buildAlbumMetadata(release *common.Release, mainRelease *common.ParsedRelea return } + // Use mainRelease's genre for all tracks if a track is missing a genre + for i := range tracks { + if tracks[i].Genre == "" { + tracks[i].Genre = mainRelease.Genre + } + } + // Album is required to have a cover art image if mainRelease.Resources.Images == nil || len(mainRelease.Resources.Images) == 0 || mainRelease.Resources.Images[0].URL == "" { *errs = append(*errs, fmt.Errorf("missing cover art image for release %s", mainRelease.ReleaseRef)) diff --git a/packages/ddex/ingester/parser/parser.go b/packages/ddex/ingester/parser/parser.go index ef2ec868d74..2bc1394b698 100644 --- a/packages/ddex/ingester/parser/parser.go +++ b/packages/ddex/ingester/parser/parser.go @@ -354,6 +354,13 @@ func (p *Parser) parseBatch(batch *common.UnprocessedBatch, deliveryRemotePath s // Validate the URL without the prefix "/" releaseURL := strings.TrimPrefix(safeInnerText(messageInBatch.SelectElement("URL")), "/") + + // Special case for Fuga deliveries with a different URL format + if strings.Contains(releaseURL, "ddex-prod-fuga-raw") { + releaseURL = strings.SplitAfter(releaseURL, "ddex-prod-fuga-raw//")[1] + releaseURL = fmt.Sprintf("%s/%s", strings.Split(targetRelease.XmlFilePath, "/")[0], releaseURL) + } + if releaseURL != targetRelease.XmlFilePath { err := fmt.Errorf("URL '%s' does not match expected value: '%s'", releaseURL, targetRelease.XmlFilePath) batch.ValidationErrors = append(batch.ValidationErrors, err.Error()) diff --git a/packages/ddex/publisher/src/models/publishedReleases.ts b/packages/ddex/publisher/src/models/publishedReleases.ts index ec6dc153b16..6c6ea675653 100644 --- a/packages/ddex/publisher/src/models/publishedReleases.ts +++ b/packages/ddex/publisher/src/models/publishedReleases.ts @@ -1,5 +1,4 @@ import mongoose from 'mongoose' -import { releaseSchema } from './pendingReleases' // DDEX releases that have been published const publishedReleasesSchema = new mongoose.Schema({ @@ -8,7 +7,7 @@ const publishedReleasesSchema = new mongoose.Schema({ entity_id: String, blockhash: String, blocknumber: Number, - release: releaseSchema, + release: { type: mongoose.Schema.Types.Mixed, default: null }, created_at: Date, }) diff --git a/packages/libs/src/sdk/types/DDEX.ts b/packages/libs/src/sdk/types/DDEX.ts index 8e2471e2731..934a777aa12 100644 --- a/packages/libs/src/sdk/types/DDEX.ts +++ b/packages/libs/src/sdk/types/DDEX.ts @@ -4,7 +4,7 @@ export const DDEXResourceContributor = z .object({ name: z.string(), roles: z.array(z.string()), - sequence_number: z.number().positive() + sequence_number: z.optional(z.number()) }) .strict()