musora-content-services 2.28.0 → 2.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +8 -0
- package/CHANGELOG.md +7 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +17 -7
- package/src/services/sanity.js +10 -37
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.28.1](https://github.com/railroadmedia/musora-content-services/compare/v2.28.0...v2.28.1) (2025-07-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **T3PS-134:** playalong artist field fix ([#371](https://github.com/railroadmedia/musora-content-services/issues/371)) ([21da213](https://github.com/railroadmedia/musora-content-services/commit/21da2132abb7c2b008260277a73f9f17527e8aeb))
|
|
11
|
+
|
|
5
12
|
## [2.28.0](https://github.com/railroadmedia/musora-content-services/compare/v2.27.5...v2.28.0) (2025-07-24)
|
|
6
13
|
|
|
7
14
|
|
package/link_mcs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentTypeConfig.js
CHANGED
|
@@ -14,7 +14,7 @@ export const DEFAULT_FIELDS = [
|
|
|
14
14
|
"'id': railcontent_id",
|
|
15
15
|
'railcontent_id',
|
|
16
16
|
artistOrInstructorName(),
|
|
17
|
-
'artist',
|
|
17
|
+
"'artist': artist->{ 'name': name, 'thumbnail': thumbnail_url.asset->url}",
|
|
18
18
|
'title',
|
|
19
19
|
"'image': thumbnail.asset->url",
|
|
20
20
|
"'thumbnail': thumbnail.asset->url",
|
|
@@ -43,6 +43,21 @@ export const DEFAULT_CHILD_FIELDS = [
|
|
|
43
43
|
`length_in_seconds`,
|
|
44
44
|
]
|
|
45
45
|
|
|
46
|
+
export const instructorField = `instructor[]->{
|
|
47
|
+
"id": railcontent_id,
|
|
48
|
+
name,
|
|
49
|
+
short_bio,
|
|
50
|
+
"biography": short_bio[0].children[0].text,
|
|
51
|
+
"coach_card_image": coach_card_image.asset->url,
|
|
52
|
+
"coach_profile_image": thumbnail_url.asset->url
|
|
53
|
+
}`
|
|
54
|
+
|
|
55
|
+
export const chapterField = `chapter[]{
|
|
56
|
+
chapter_description,
|
|
57
|
+
chapter_timecode,
|
|
58
|
+
"chapter_thumbnail_url": chapter_thumbnail_url.asset->url
|
|
59
|
+
}`
|
|
60
|
+
|
|
46
61
|
export const descriptionField = 'description[0].children[0].text'
|
|
47
62
|
// this pulls both any defined resources for the document as well as any resources in the parent document
|
|
48
63
|
export const resourcesField = `[
|
|
@@ -346,7 +361,6 @@ export let contentTypeConfig = {
|
|
|
346
361
|
published_on,
|
|
347
362
|
"type":_type,
|
|
348
363
|
"image": thumbnail.asset->url,
|
|
349
|
-
"instructors": instructor[]->name,
|
|
350
364
|
length_in_seconds,
|
|
351
365
|
"resources": ${resourcesField},
|
|
352
366
|
difficulty,
|
|
@@ -354,11 +368,7 @@ export let contentTypeConfig = {
|
|
|
354
368
|
artist->,
|
|
355
369
|
"thumbnail_url":thumbnail.asset->url,
|
|
356
370
|
"description": description[0].children[0].text,
|
|
357
|
-
"chapters":
|
|
358
|
-
chapter_description,
|
|
359
|
-
chapter_timecode,
|
|
360
|
-
"chapter_thumbnail_url": chapter_thumbnail_url.asset->url
|
|
361
|
-
},
|
|
371
|
+
"chapters": ${chapterField},
|
|
362
372
|
"instructors":instructor[]->name,
|
|
363
373
|
"instructor": instructor[]->{
|
|
364
374
|
"id":railcontent_id,
|
package/src/services/sanity.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
artistOrInstructorName,
|
|
6
|
+
instructorField,
|
|
7
|
+
chapterField,
|
|
6
8
|
assignmentsField,
|
|
7
9
|
descriptionField,
|
|
8
10
|
resourcesField,
|
|
@@ -1294,41 +1296,16 @@ export async function jumpToContinueContent(railcontentId) {
|
|
|
1294
1296
|
*/
|
|
1295
1297
|
export async function fetchLessonContent(railContentId) {
|
|
1296
1298
|
const filterParams = { isSingle: true, pullFutureContent: true }
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
// If you're unsure, message Adrian, or just add them.
|
|
1300
|
-
const fields = `title,
|
|
1301
|
-
published_on,
|
|
1302
|
-
"type":_type,
|
|
1299
|
+
|
|
1300
|
+
const fields = `${getFieldsForContentType()}
|
|
1303
1301
|
"resources": ${resourcesField},
|
|
1304
|
-
difficulty,
|
|
1305
|
-
difficulty_string,
|
|
1306
|
-
brand,
|
|
1307
|
-
status,
|
|
1308
1302
|
soundslice,
|
|
1309
1303
|
instrumentless,
|
|
1310
|
-
railcontent_id,
|
|
1311
|
-
"id":railcontent_id,
|
|
1312
|
-
slug, artist->,
|
|
1313
|
-
"thumbnail":thumbnail.asset->url,
|
|
1314
1304
|
soundslice_slug,
|
|
1315
|
-
"description":
|
|
1316
|
-
"chapters":
|
|
1317
|
-
chapter_description,
|
|
1318
|
-
chapter_timecode,
|
|
1319
|
-
"chapter_thumbnail_url": chapter_thumbnail_url.asset->url
|
|
1320
|
-
},
|
|
1321
|
-
'artist': { 'name': artist->name, 'thumbnail': artist->thumbnail_url.asset->url},
|
|
1305
|
+
"description": ${descriptionField},
|
|
1306
|
+
"chapters": ${chapterField},
|
|
1322
1307
|
"instructors":instructor[]->name,
|
|
1323
|
-
"instructor":
|
|
1324
|
-
"id":railcontent_id,
|
|
1325
|
-
name,
|
|
1326
|
-
short_bio,
|
|
1327
|
-
"biography": short_bio[0].children[0].text,
|
|
1328
|
-
web_url_path,
|
|
1329
|
-
"coach_card_image": coach_card_image.asset->url,
|
|
1330
|
-
"coach_profile_image":thumbnail_url.asset->url
|
|
1331
|
-
},
|
|
1308
|
+
"instructor": ${instructorField},
|
|
1332
1309
|
${assignmentsField}
|
|
1333
1310
|
video,
|
|
1334
1311
|
length_in_seconds,
|
|
@@ -1346,9 +1323,6 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1346
1323
|
"dark_mode_logo": *[railcontent_id == ^.id][0].dark_mode_logo_url.asset->url,
|
|
1347
1324
|
"light_mode_logo": *[railcontent_id == ^.id][0].light_mode_logo_url.asset->url,
|
|
1348
1325
|
},
|
|
1349
|
-
sort,
|
|
1350
|
-
xp,
|
|
1351
|
-
stbs,ds2stbs, bdsStbs,
|
|
1352
1326
|
...select(
|
|
1353
1327
|
defined(live_event_start_time) => {
|
|
1354
1328
|
"live_event_start_time": live_event_start_time,
|
|
@@ -1361,6 +1335,7 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1361
1335
|
const query = await buildQuery(`railcontent_id == ${railContentId}`, filterParams, fields, {
|
|
1362
1336
|
isSingle: true,
|
|
1363
1337
|
})
|
|
1338
|
+
console.log('query', query)
|
|
1364
1339
|
const chapterProcess = (result) => {
|
|
1365
1340
|
const now = getSanityDate(new Date(), false)
|
|
1366
1341
|
if (result.live_event_start_time && result.live_event_end_time) {
|
|
@@ -1372,6 +1347,7 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1372
1347
|
...chapter,
|
|
1373
1348
|
chapter_thumbnail_url: `https://musora-web-platform.s3.amazonaws.com/chapters/${result.brand}/Chapter${index + 1}.jpg`,
|
|
1374
1349
|
}))
|
|
1350
|
+
console.log('result', result)
|
|
1375
1351
|
return result
|
|
1376
1352
|
}
|
|
1377
1353
|
|
|
@@ -1622,10 +1598,7 @@ export async function fetchLiveEvent(brand, forcedContentId = null) {
|
|
|
1622
1598
|
"thumbnail": thumbnail.asset->url,
|
|
1623
1599
|
${artistOrInstructorName()},
|
|
1624
1600
|
difficulty_string,
|
|
1625
|
-
"instructors":
|
|
1626
|
-
name,
|
|
1627
|
-
web_url_path,
|
|
1628
|
-
},
|
|
1601
|
+
"instructors": ${instructorField},
|
|
1629
1602
|
'videoId': coalesce(live_event_youtube_id, video.external_id),
|
|
1630
1603
|
} | order(live_event_start_time)[0...1]`
|
|
1631
1604
|
: `*[status == 'scheduled' && brand == '${brand}' && defined(live_event_start_time) && live_event_start_time <= '${getSanityDate(startDateTemp, false)}' && live_event_end_time >= '${getSanityDate(endDateTemp, false)}']{
|