musora-content-services 2.28.0 → 2.28.2
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 +14 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +17 -7
- package/src/services/sanity.js +12 -39
- package/src/services/userActivity.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.2](https://github.com/railroadmedia/musora-content-services/compare/v2.28.1...v2.28.2) (2025-07-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **BEH-873:** Lessons Featuring this Song and Other Versions of this Song, restricted to current brand ([#377](https://github.com/railroadmedia/musora-content-services/issues/377)) ([df4d5d7](https://github.com/railroadmedia/musora-content-services/commit/df4d5d7eb1e99c922844682f966cc3145b914291))
|
|
11
|
+
|
|
12
|
+
### [2.28.1](https://github.com/railroadmedia/musora-content-services/compare/v2.28.0...v2.28.1) (2025-07-24)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **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))
|
|
18
|
+
|
|
5
19
|
## [2.28.0](https://github.com/railroadmedia/musora-content-services/compare/v2.27.5...v2.28.0) (2025-07-24)
|
|
6
20
|
|
|
7
21
|
|
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
|
|
|
@@ -1435,7 +1411,8 @@ export async function fetchLessonsFeaturingThisContent(railcontentId, brand, cou
|
|
|
1435
1411
|
*/
|
|
1436
1412
|
async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, count) {
|
|
1437
1413
|
const typeCheck = `@->_type in [${arrayJoinWithQuotes(SONG_TYPES)}]`
|
|
1438
|
-
|
|
1414
|
+
let typeCheckString = `@->brand == '${brand}' && `
|
|
1415
|
+
typeCheckString += onlyUseSongTypes ? `${typeCheck}` : `!(${typeCheck})`
|
|
1439
1416
|
const contentFromLicenseFilter = `_type == 'license' && references(^._id)].content[${typeCheckString} && @->railcontent_id != ${railcontentId}`
|
|
1440
1417
|
let filterSongTypesWithSameLicense = await new FilterBuilder(contentFromLicenseFilter, {
|
|
1441
1418
|
isChildrenFilter: true,
|
|
@@ -1452,7 +1429,6 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1452
1429
|
"related_by_license" :
|
|
1453
1430
|
*[${filterSongTypesWithSameLicense}]->{${queryFields}}|order(published_on desc, title asc)[0...${count}],
|
|
1454
1431
|
}[0...1]`
|
|
1455
|
-
|
|
1456
1432
|
const results = await fetchSanity(query, false)
|
|
1457
1433
|
return results['related_by_license'] ?? []
|
|
1458
1434
|
}
|
|
@@ -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)}']{
|
|
@@ -1237,6 +1237,8 @@ async function processPlaylistItem(item) {
|
|
|
1237
1237
|
brand: playlist.brand,
|
|
1238
1238
|
id: playlist.id,
|
|
1239
1239
|
itemId: nextItem.id,
|
|
1240
|
+
lastEngagedOn: playlist.last_engaged_on,
|
|
1241
|
+
lastEngagedOnItem: playlist.last_engaged_on_item,
|
|
1240
1242
|
type: 'playlists',
|
|
1241
1243
|
}
|
|
1242
1244
|
}
|