musora-content-services 2.140.9 → 2.141.0
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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +3 -2
- package/src/services/contentProgress.js +20 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.141.0](https://github.com/railroadmedia/musora-content-services/compare/v2.140.9...v2.141.0) (2026-03-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* change your progress section to display parents ([#883](https://github.com/railroadmedia/musora-content-services/issues/883)) ([66e4678](https://github.com/railroadmedia/musora-content-services/commit/66e4678f20c781c5d66c59e5c9ce488c63dc5301))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **T3PS-2319:** setup livestream progress ([#878](https://github.com/railroadmedia/musora-content-services/issues/878)) ([d1284c6](https://github.com/railroadmedia/musora-content-services/commit/d1284c69bf35cd4cdaf9a4b448767dc615a6dbf1))
|
|
16
|
+
|
|
5
17
|
### [2.140.9](https://github.com/railroadmedia/musora-content-services/compare/v2.140.8...v2.140.9) (2026-03-24)
|
|
6
18
|
|
|
7
19
|
|
package/package.json
CHANGED
package/src/contentTypeConfig.js
CHANGED
|
@@ -367,6 +367,7 @@ export const parentRecentTypes = [
|
|
|
367
367
|
'play-along',
|
|
368
368
|
'jam-track',
|
|
369
369
|
'song-tutorial',
|
|
370
|
+
...liveArchivesLessonTypes,
|
|
370
371
|
]
|
|
371
372
|
|
|
372
373
|
const songsRecentTypes = [...SONG_TYPES]
|
|
@@ -374,7 +375,7 @@ const songsRecentTypes = [...SONG_TYPES]
|
|
|
374
375
|
export const recentTypes = {
|
|
375
376
|
lessons: lessonRecentTypes,
|
|
376
377
|
songs: songsRecentTypes,
|
|
377
|
-
home:
|
|
378
|
+
home: parentRecentTypes,
|
|
378
379
|
homeRow: parentRecentTypes,
|
|
379
380
|
}
|
|
380
381
|
|
|
@@ -672,7 +673,7 @@ export let contentTypeConfig = {
|
|
|
672
673
|
],
|
|
673
674
|
'new-and-scheduled': {
|
|
674
675
|
fields: [
|
|
675
|
-
'show_in_new_feed',
|
|
676
|
+
'show_in_new_feed',
|
|
676
677
|
isLiveField()
|
|
677
678
|
],
|
|
678
679
|
},
|
|
@@ -399,12 +399,16 @@ async function _getAllStartedOrCompleted({
|
|
|
399
399
|
* Record watch session
|
|
400
400
|
* @return {string} sessionId - provide in future calls to update progress
|
|
401
401
|
* @param {int} contentId
|
|
402
|
-
* @param {
|
|
403
|
-
* @param {
|
|
404
|
-
* @param {int}
|
|
405
|
-
* @param {
|
|
406
|
-
* @param {int}
|
|
407
|
-
* @param {int}
|
|
402
|
+
* @param {any} collection - progress collection context, null if a-la-carte
|
|
403
|
+
* @param {string} collection.type - enum value of collection type
|
|
404
|
+
* @param {int} collection.id - content_id of parent collection (e.g. learning path content_id)
|
|
405
|
+
* @param {int} mediaLengthSeconds - total length of video media || live event duration if livestream
|
|
406
|
+
* @param {int} currentSeconds - seconds timestamp relative to beginning of video
|
|
407
|
+
* @param {int} secondsPlayed - seconds played in this watch session (since last pause)
|
|
408
|
+
* @param {any} prevSession - This function records a sessionId to pass into future updates to progress on the same video
|
|
409
|
+
* @param {int|null} instrumentId - enum value of instrument id
|
|
410
|
+
* @param {int|null} categoryId - enum value of category id
|
|
411
|
+
* @param {boolean} isLivestream - determines livestream-specific progress handling
|
|
408
412
|
*/
|
|
409
413
|
export async function recordWatchSession(
|
|
410
414
|
contentId,
|
|
@@ -414,7 +418,8 @@ export async function recordWatchSession(
|
|
|
414
418
|
secondsPlayed,
|
|
415
419
|
prevSession = null,
|
|
416
420
|
instrumentId = null,
|
|
417
|
-
categoryId = null
|
|
421
|
+
categoryId = null,
|
|
422
|
+
isLivestream = false,
|
|
418
423
|
) {
|
|
419
424
|
contentId = normalizeContentId(contentId)
|
|
420
425
|
collection = normalizeCollection(collection)
|
|
@@ -428,7 +433,7 @@ export async function recordWatchSession(
|
|
|
428
433
|
// Track practice and progress locally (no immediate push)
|
|
429
434
|
await Promise.all([
|
|
430
435
|
trackPractice(contentId, secondsPlayed, { instrumentId, categoryId }),
|
|
431
|
-
trackProgress(contentId, collection, currentSeconds, mediaLengthSeconds),
|
|
436
|
+
trackProgress(contentId, collection, currentSeconds, mediaLengthSeconds, isLivestream),
|
|
432
437
|
])
|
|
433
438
|
|
|
434
439
|
if (!prevSession.pushInterval) {
|
|
@@ -453,11 +458,17 @@ async function trackPractice(contentId, secondsPlayed, details = {}) {
|
|
|
453
458
|
return trackUserPractice(contentId, secondsPlayed, details)
|
|
454
459
|
}
|
|
455
460
|
|
|
456
|
-
async function trackProgress(contentId, collection, currentSeconds, mediaLengthSeconds) {
|
|
461
|
+
async function trackProgress(contentId, collection, currentSeconds, mediaLengthSeconds, isLivestream = false) {
|
|
457
462
|
const progress = Math.max(1, Math.min(
|
|
458
463
|
99,
|
|
459
464
|
Math.round(((currentSeconds ?? 0) / Math.max(1, mediaLengthSeconds)) * 100)
|
|
460
465
|
))
|
|
466
|
+
|
|
467
|
+
if (isLivestream) {
|
|
468
|
+
// resumeTime of a livestream will far exceed VOD length, so set to 0
|
|
469
|
+
// doesn't affect livestream resumeTime, but will send users to 0 seconds in VOD
|
|
470
|
+
currentSeconds = 0
|
|
471
|
+
}
|
|
461
472
|
return saveContentProgress(contentId, collection, progress, currentSeconds, { skipPush: true })
|
|
462
473
|
}
|
|
463
474
|
|