ddex-core 0.4.5

Shared DDEX data models and utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
//! Test data for extension system testing with real-world DDEX examples

/// Real-world DDEX XML with Spotify extensions
pub const DDEX_WITH_SPOTIFY_EXTENSIONS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Spotify DDEX System-->
<ern:NewReleaseMessage xmlns:ern="http://ddex.net/xml/ern/43" xmlns:spotify="http://spotify.com/ddex/extensions">
  <MessageHeader>
    <MessageId>SPOTIFY_DDEX_20241201_001</MessageId>
    <MessageSender>
      <PartyName>Spotify AB</PartyName>
      <spotify:SpotifyMetadata>
        <spotify:IngestingTeam>Content Operations</spotify:IngestingTeam>
        <spotify:Priority>High</spotify:Priority>
        <spotify:InternalNotes>Priority release for featured artist</spotify:InternalNotes>
      </spotify:SpotifyMetadata>
    </MessageSender>
    <MessageRecipient>
      <PartyName>Universal Music Group</PartyName>
    </MessageRecipient>
    <MessageCreatedDateTime>2024-12-01T10:30:00Z</MessageCreatedDateTime>
  </MessageHeader>
  <ReleaseList>
    <Release>
      <ReleaseId>
        <ISRC>GBUM71507609</ISRC>
        <ProprietaryId>UMG_REL_2024_001</ProprietaryId>
        <spotify:SpotifyAlbumId>1a2b3c4d5e6f7g8h9i0j</spotify:SpotifyAlbumId>
      </ReleaseId>
      <ReleaseReference>R1</ReleaseReference>
      <ReferenceTitle>
        <TitleText>Amazing Album</TitleText>
        <SubTitle>Deluxe Edition</SubTitle>
      </ReferenceTitle>
      <spotify:ReleaseMetadata>
        <spotify:PlaylistEligible>true</spotify:PlaylistEligible>
        <spotify:GenrePreferences>
          <spotify:Genre weight="0.8">pop</spotify:Genre>
          <spotify:Genre weight="0.2">electronic</spotify:Genre>
        </spotify:GenrePreferences>
        <spotify:MarketingFlags>
          <spotify:Flag type="editorial">featured</spotify:Flag>
          <spotify:Flag type="algorithmic">boost</spotify:Flag>
        </spotify:MarketingFlags>
      </spotify:ReleaseMetadata>
      <ReleaseResourceReferenceList>
        <ReleaseResourceReference>
          <A1>Track01</A1>
        </ReleaseResourceReference>
      </ReleaseResourceReferenceList>
    </Release>
  </ReleaseList>
  <ResourceList>
    <SoundRecording>
      <ResourceReference>Track01</ResourceReference>
      <ReferenceTitle>
        <TitleText>Hit Single</TitleText>
      </ReferenceTitle>
      <SoundRecordingId>
        <ISRC>GBUM71507610</ISRC>
        <spotify:SpotifyTrackId>0z1y2x3w4v5u6t7s8r9q</spotify:SpotifyTrackId>
      </SoundRecordingId>
      <spotify:TrackMetadata>
        <spotify:AudioFeatures>
          <spotify:Danceability>0.742</spotify:Danceability>
          <spotify:Energy>0.856</spotify:Energy>
          <spotify:Valence>0.632</spotify:Valence>
          <spotify:Tempo>128.5</spotify:Tempo>
        </spotify:AudioFeatures>
        <spotify:ContentTags>
          <spotify:Tag>explicit-lyrics</spotify:Tag>
          <spotify:Tag>radio-edit</spotify:Tag>
        </spotify:ContentTags>
      </spotify:TrackMetadata>
      <DisplayArtist>
        <PartyName>
          <FullName>Amazing Artist</FullName>
        </PartyName>
      </DisplayArtist>
    </SoundRecording>
  </ResourceList>
</ern:NewReleaseMessage>"#;

/// DDEX XML with YouTube Music extensions
pub const DDEX_WITH_YOUTUBE_EXTENSIONS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
<?youtube-processing-instruction version="2.1" priority="high"?>
<ern:NewReleaseMessage xmlns:ern="http://ddex.net/xml/ern/43" xmlns:ytm="http://youtube.com/music/ddex">
  <MessageHeader>
    <MessageId>YTM_DELIVERY_20241201_002</MessageId>
    <MessageSender>
      <PartyName>YouTube Music</PartyName>
      <ytm:DeliveryMetadata>
        <ytm:DeliveryChannel>automated</ytm:DeliveryChannel>
        <ytm:ProcessingQueue>priority</ytm:ProcessingQueue>
        <ytm:RetryPolicy>
          <ytm:MaxRetries>3</ytm:MaxRetries>
          <ytm:BackoffStrategy>exponential</ytm:BackoffStrategy>
        </ytm:RetryPolicy>
      </ytm:DeliveryMetadata>
    </MessageSender>
    <MessageRecipient>
      <PartyName>Sony Music Entertainment</PartyName>
    </MessageRecipient>
    <MessageCreatedDateTime>2024-12-01T11:15:00Z</MessageCreatedDateTime>
  </MessageHeader>
  <ReleaseList>
    <Release>
      <ReleaseId>
        <ISRC>USSM11900123</USSM11900123>
        <ProprietaryId>SONY_REL_2024_456</ProprietaryId>
        <ytm:YouTubeMusicAlbumId>PLrAKsdTkSIRQp-HIyx</ytm:YouTubeMusicAlbumId>
      </ReleaseId>
      <ReleaseReference>R2</ReleaseReference>
      <ReferenceTitle>
        <TitleText>Viral Hits Collection</TitleText>
      </ReferenceTitle>
      <ytm:VideoMetadata>
        <ytm:ContentCategory>Music</ytm:ContentCategory>
        <ytm:Monetization enabled="true">
          <ytm:AdFormats>
            <ytm:Format>pre-roll</ytm:Format>
            <ytm:Format>mid-roll</ytm:Format>
          </ytm:AdFormats>
        </ytm:Monetization>
        <ytm:Analytics>
          <ytm:TrackViews>true</ytm:TrackViews>
          <ytm:TrackEngagement>true</ytm:TrackEngagement>
        </ytm:Analytics>
      </ytm:VideoMetadata>
    </Release>
  </ReleaseList>
  <ResourceList>
    <SoundRecording>
      <ResourceReference>Track02</ResourceReference>
      <ReferenceTitle>
        <TitleText>Trending Song</TitleText>
      </ReferenceTitle>
      <SoundRecordingId>
        <ISRC>USSM11900124</ISRC>
        <ytm:YouTubeVideoId>dQw4w9WgXcQ</ytm:YouTubeVideoId>
      </SoundRecordingId>
      <ytm:ContentMetadata>
        <ytm:MusicVideo available="true">
          <ytm:Resolution>4K</ytm:Resolution>
          <ytm:AspectRatio>16:9</ytm:AspectRatio>
        </ytm:MusicVideo>
        <ytm:Lyrics>
          <ytm:Type>synchronized</ytm:Type>
          <ytm:Language>en</ytm:Language>
          <ytm:Source>official</ytm:Source>
        </ytm:Lyrics>
        <ytm:RecommendationTags>
          <ytm:Tag category="mood">upbeat</ytm:Tag>
          <ytm:Tag category="activity">workout</ytm:Tag>
        </ytm:RecommendationTags>
      </ytm:ContentMetadata>
      <DisplayArtist>
        <PartyName>
          <FullName>Viral Artist</FullName>
        </PartyName>
      </DisplayArtist>
    </SoundRecording>
  </ResourceList>
</ern:NewReleaseMessage>"#;

/// DDEX XML with Apple Music extensions
pub const DDEX_WITH_APPLE_EXTENSIONS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
<!--Apple Music Content Ingestion System v3.2-->
<ern:NewReleaseMessage xmlns:ern="http://ddex.net/xml/ern/43" xmlns:apple="http://apple.com/itunes/ddex">
  <MessageHeader>
    <MessageId>APPLE_INGESTION_20241201_003</MessageId>
    <MessageSender>
      <PartyName>Apple Inc.</PartyName>
    </MessageSender>
    <MessageRecipient>
      <PartyName>Warner Music Group</PartyName>
      <apple:DistributorMetadata>
        <apple:TerritoryManager>EMEA</apple:TerritoryManager>
        <apple:ContentTier>Premium</apple:ContentTier>
        <apple:ProcessingPreferences>
          <apple:QualityCheck>strict</apple:QualityCheck>
          <apple:MetadataValidation>enhanced</apple:MetadataValidation>
        </apple:ProcessingPreferences>
      </apple:DistributorMetadata>
    </MessageRecipient>
    <MessageCreatedDateTime>2024-12-01T12:00:00Z</MessageCreatedDateTime>
  </MessageHeader>
  <ReleaseList>
    <Release>
      <ReleaseId>
        <ISRC>GBF077700123</ISRC>
        <ProprietaryId>WMG_REL_2024_789</ProprietaryId>
        <apple:iTunesId>1234567890</apple:iTunesId>
      </ReleaseId>
      <ReleaseReference>R3</ReleaseReference>
      <ReferenceTitle>
        <TitleText>Spatial Audio Masterpiece</TitleText>
      </ReferenceTitle>
      <apple:ReleaseEnhancements>
        <apple:SpatialAudio>
          <apple:Available>true</apple:Available>
          <apple:Format>Dolby Atmos</apple:Format>
          <apple:BitrateKbps>1411</apple:BitrateKbps>
        </apple:SpatialAudio>
        <apple:LosslessAudio>
          <apple:Available>true</apple:Available>
          <apple:Format>ALAC</apple:Format>
          <apple:BitDepth>24</apple:BitDepth>
          <apple:SampleRate>96000</apple:SampleRate>
        </apple:LosslessAudio>
        <apple:AnimatedArtwork>
          <apple:Available>true</apple:Available>
          <apple:Duration>PT15S</apple:Duration>
        </apple:AnimatedArtwork>
      </apple:ReleaseEnhancements>
    </Release>
  </ReleaseList>
  <ResourceList>
    <SoundRecording>
      <ResourceReference>Track03</ResourceReference>
      <ReferenceTitle>
        <TitleText>Immersive Experience</TitleText>
      </ReferenceTitle>
      <SoundRecordingId>
        <ISRC>GBF077700124</ISRC>
        <apple:iTunesTrackId>987654321</apple:iTunesTrackId>
      </SoundRecordingId>
      <apple:TrackEnhancements>
        <apple:Mastering>
          <apple:MasteredFor>iTunes</apple:MasteredFor>
          <apple:LoudnessLUFS>-16.0</apple:LoudnessLUFS>
          <apple:TruePeak>-1.0</apple:TruePeak>
        </apple:Mastering>
        <apple:Lyrics>
          <apple:Type>time-synced</apple:Type>
          <apple:Provider>LyricFind</apple:Provider>
          <apple:Karaoke>available</apple:Karaoke>
        </apple:Lyrics>
      </apple:TrackEnhancements>
      <DisplayArtist>
        <PartyName>
          <FullName>Immersive Artist</FullName>
        </PartyName>
      </DisplayArtist>
    </SoundRecording>
  </ResourceList>
</ern:NewReleaseMessage>"#;

/// DDEX XML with multiple proprietary extensions (complex example)
pub const DDEX_WITH_MULTIPLE_EXTENSIONS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
<?custom-processing version="1.0" system="multi-platform"?>
<!--Multi-platform distribution system-->
<ern:NewReleaseMessage xmlns:ern="http://ddex.net/xml/ern/43" 
                       xmlns:analytics="http://example.com/analytics" 
                       xmlns:blockchain="http://example.com/blockchain"
                       xmlns:ml="http://example.com/machine-learning">
  <MessageHeader>
    <MessageId>MULTI_PLATFORM_20241201_004</MessageId>
    <MessageSender>
      <PartyName>Distribution Hub</PartyName>
      <analytics:TrackingMetadata>
        <analytics:SessionId>sess_abc123def456</analytics:SessionId>
        <analytics:UserId>user_789xyz</analytics:UserId>
        <analytics:Platform>web</analytics:Platform>
        <analytics:Version>2.4.1</analytics:Version>
      </analytics:TrackingMetadata>
    </MessageSender>
    <MessageRecipient>
      <PartyName>Independent Label</PartyName>
    </MessageRecipient>
    <MessageCreatedDateTime>2024-12-01T13:45:00Z</MessageCreatedDateTime>
    <blockchain:Rights>
      <blockchain:SmartContract>0x1234567890abcdef</blockchain:SmartContract>
      <blockchain:Network>ethereum</blockchain:Network>
      <blockchain:TokenStandard>ERC-721</blockchain:TokenStandard>
    </blockchain:Rights>
  </MessageHeader>
  <ReleaseList>
    <Release>
      <ReleaseId>
        <ISRC>INDIE12300456</ISRC>
        <ProprietaryId>INDIE_REL_2024_101</ProprietaryId>
        <blockchain:NFTTokenId>42</blockchain:NFTTokenId>
      </ReleaseId>
      <ReleaseReference>R4</ReleaseReference>
      <ReferenceTitle>
        <TitleText>AI-Generated Masterpiece</TitleText>
      </ReferenceTitle>
      <ml:GenerationMetadata>
        <ml:Model>
          <ml:Name>MusicGPT-Ultra</ml:Name>
          <ml:Version>3.5</ml:Version>
          <ml:TrainingDate>2024-11-01</ml:TrainingDate>
        </ml:Model>
        <ml:CreationProcess>
          <ml:Prompt>Create an uplifting electronic track with orchestral elements</ml:Prompt>
          <ml:Seed>987654321</ml:Seed>
          <ml:Temperature>0.7</ml:Temperature>
          <ml:Iterations>50</ml:Iterations>
        </ml:CreationProcess>
        <ml:HumanContribution>
          <ml:Percentage>25</ml:Percentage>
          <ml:Aspects>
            <ml:Aspect>lyrics</ml:Aspect>
            <ml:Aspect>final-arrangement</ml:Aspect>
          </ml:Aspects>
        </ml:HumanContribution>
      </ml:GenerationMetadata>
      <blockchain:Ownership>
        <blockchain:Splits>
          <blockchain:Split beneficiary="artist" percentage="60.0"/>
          <blockchain:Split beneficiary="producer" percentage="25.0"/>
          <blockchain:Split beneficiary="label" percentage="15.0"/>
        </blockchain:Splits>
      </blockchain:Ownership>
    </Release>
  </ReleaseList>
  <ResourceList>
    <SoundRecording>
      <ResourceReference>Track04</ResourceReference>
      <ReferenceTitle>
        <TitleText>Digital Symphony</TitleText>
      </ReferenceTitle>
      <SoundRecordingId>
        <ISRC>INDIE12300457</ISRC>
        <blockchain:AssetHash>QmX1Y2Z3...</blockchain:AssetHash>
      </SoundRecordingId>
      <analytics:Performance>
        <analytics:PredictedStreams>
          <analytics:Platform name="spotify">1250000</analytics:Platform>
          <analytics:Platform name="apple">850000</analytics:Platform>
          <analytics:Platform name="youtube">2100000</analytics:Platform>
        </analytics:PredictedStreams>
        <analytics:Demographics>
          <analytics:AgeGroup range="18-24" percentage="35"/>
          <analytics:AgeGroup range="25-34" percentage="42"/>
          <analytics:AgeGroup range="35-44" percentage="23"/>
        </analytics:Demographics>
      </analytics:Performance>
      <ml:AudioAnalysis>
        <ml:Tempo>132.5</ml:Tempo>
        <ml:Key>C Major</ml:Key>
        <ml:Mood confidence="0.92">euphoric</ml:Mood>
        <ml:Genre confidence="0.87">electronic-orchestral</ml:Genre>
        <ml:Instruments>
          <ml:Instrument confidence="0.95">synthesizer</ml:Instrument>
          <ml:Instrument confidence="0.88">strings</ml:Instrument>
          <ml:Instrument confidence="0.76">piano</ml:Instrument>
        </ml:Instruments>
      </ml:AudioAnalysis>
      <DisplayArtist>
        <PartyName>
          <FullName>AI Composer</FullName>
        </PartyName>
        <ml:ArtistType>hybrid</ml:ArtistType>
      </DisplayArtist>
    </SoundRecording>
  </ResourceList>
  <analytics:MessageFooter>
    <analytics:ProcessingTime>PT0.247S</analytics:ProcessingTime>
    <analytics:ValidationScore>98.5</analytics:ValidationScore>
    <analytics:ExtensionCount>15</analytics:ExtensionCount>
  </analytics:MessageFooter>
</ern:NewReleaseMessage>"#;

/// Simple DDEX XML without extensions for comparison
pub const DDEX_WITHOUT_EXTENSIONS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
<ern:NewReleaseMessage xmlns:ern="http://ddex.net/xml/ern/43">
  <MessageHeader>
    <MessageId>SIMPLE_MSG_20241201_005</MessageId>
    <MessageSender>
      <PartyName>Simple Label</PartyName>
    </MessageSender>
    <MessageRecipient>
      <PartyName>Simple Distributor</PartyName>
    </MessageRecipient>
    <MessageCreatedDateTime>2024-12-01T14:00:00Z</MessageCreatedDateTime>
  </MessageHeader>
  <ReleaseList>
    <Release>
      <ReleaseId>
        <ISRC>SIMPLE12300123</ISRC>
        <ProprietaryId>SIMPLE_REL_001</ProprietaryId>
      </ReleaseId>
      <ReleaseReference>R5</ReleaseReference>
      <ReferenceTitle>
        <TitleText>Basic Album</TitleText>
      </ReferenceTitle>
    </Release>
  </ReleaseList>
  <ResourceList>
    <SoundRecording>
      <ResourceReference>Track05</ResourceReference>
      <ReferenceTitle>
        <TitleText>Simple Song</TitleText>
      </ReferenceTitle>
      <SoundRecordingId>
        <ISRC>SIMPLE12300124</ISRC>
      </SoundRecordingId>
      <DisplayArtist>
        <PartyName>
          <FullName>Simple Artist</FullName>
        </PartyName>
      </DisplayArtist>
    </SoundRecording>
  </ResourceList>
</ern:NewReleaseMessage>"#;