musora-content-services 2.33.6 → 2.33.7
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
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.33.7](https://github.com/railroadmedia/musora-content-services/compare/v2.33.6...v2.33.7) (2025-09-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add published on to navigate_to ([#424](https://github.com/railroadmedia/musora-content-services/issues/424)) ([2a73222](https://github.com/railroadmedia/musora-content-services/commit/2a73222f0b8278ef2026ab4013cb10d331e0f94a))
|
|
11
|
+
|
|
5
12
|
### [2.33.6](https://github.com/railroadmedia/musora-content-services/compare/v2.33.5...v2.33.6) (2025-09-03)
|
|
6
13
|
|
|
7
14
|
### [2.33.5](https://github.com/railroadmedia/musora-content-services/compare/v2.33.1...v2.33.5) (2025-09-03)
|
package/package.json
CHANGED
|
File without changes
|
package/src/services/sanity.js
CHANGED
|
@@ -2184,11 +2184,12 @@ export async function fetchTabData(
|
|
|
2184
2184
|
let filter = ''
|
|
2185
2185
|
|
|
2186
2186
|
filter = `brand == "${brand}" ${includedFieldsFilter}`
|
|
2187
|
-
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
2187
|
+
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true, pullFutureContent: true }).buildFilter()
|
|
2188
|
+
const childrenFields = await getChildFieldsForContentType('tab-data')
|
|
2188
2189
|
const lessonCountFilter = await new FilterBuilder(`_id in ^.child[]._ref`).buildFilter()
|
|
2189
2190
|
entityFieldsString =
|
|
2190
2191
|
` ${fieldsString}
|
|
2191
|
-
'children': child[${childrenFilter}]->{
|
|
2192
|
+
'children': child[${childrenFilter}]->{ ${childrenFields} },
|
|
2192
2193
|
'isLive': live_event_start_time <= "${now}" && live_event_end_time >= "${now}",
|
|
2193
2194
|
'lesson_count': coalesce(count(*[${lessonCountFilter}]), 0),
|
|
2194
2195
|
'length_in_seconds': coalesce(
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { DataContext, UserActivityVersionKey } from './dataContext.js'
|
|
14
14
|
import { fetchByRailContentId, fetchByRailContentIds, fetchShows } from './sanity'
|
|
15
15
|
import { fetchPlaylist, fetchUserPlaylists } from './content-org/playlists'
|
|
16
|
-
import { pinnedGuidedCourses
|
|
16
|
+
import {guidedCourses, pinnedGuidedCourses} from './content-org/guided-courses'
|
|
17
17
|
import {
|
|
18
18
|
getMonday,
|
|
19
19
|
getWeekNumber,
|
|
@@ -1051,13 +1051,19 @@ function generateContentsMap(contents, playlistsContents) {
|
|
|
1051
1051
|
*/
|
|
1052
1052
|
export async function getProgressRows({ brand = null, limit = 8 } = {}) {
|
|
1053
1053
|
// TODO slice progress to a reasonable number, say 100
|
|
1054
|
-
|
|
1054
|
+
|
|
1055
|
+
const [recentPlaylists, progressContents, allPinnedGuidedCourse, userPinnedItem, enrolledGuidedCourses] =
|
|
1055
1056
|
await Promise.all([
|
|
1056
1057
|
fetchUserPlaylists(brand, { sort: '-last_progress', limit: limit }),
|
|
1057
1058
|
getAllStartedOrCompleted({ onlyIds: false, brand: brand }),
|
|
1058
1059
|
pinnedGuidedCourses(brand),
|
|
1059
1060
|
getUserPinnedItem(brand),
|
|
1061
|
+
guidedCourses()
|
|
1060
1062
|
])
|
|
1063
|
+
|
|
1064
|
+
const enrolledGuidedCoursesIds = enrolledGuidedCourses.map(course => String(course.content_id));
|
|
1065
|
+
|
|
1066
|
+
const mergedGuidedCourses = 1 //get all cuigded courses, incl no progress.
|
|
1061
1067
|
let pinnedGuidedCourse = allPinnedGuidedCourse?.[0] ?? null
|
|
1062
1068
|
|
|
1063
1069
|
const playlists = recentPlaylists?.data || []
|
|
@@ -1067,12 +1073,15 @@ export async function getProgressRows({ brand = null, limit = 8 } = {}) {
|
|
|
1067
1073
|
)
|
|
1068
1074
|
|
|
1069
1075
|
const nonPlaylistContentIds = Object.keys(progressContents)
|
|
1070
|
-
if (
|
|
1071
|
-
nonPlaylistContentIds.push(
|
|
1076
|
+
if (enrolledGuidedCoursesIds.length > 0) {
|
|
1077
|
+
nonPlaylistContentIds.push(...enrolledGuidedCoursesIds)
|
|
1072
1078
|
}
|
|
1073
1079
|
if (userPinnedItem?.progressType === 'content') {
|
|
1074
1080
|
nonPlaylistContentIds.push(userPinnedItem.id)
|
|
1075
1081
|
}
|
|
1082
|
+
console.log("nonPlaylistContentIds",nonPlaylistContentIds)
|
|
1083
|
+
|
|
1084
|
+
|
|
1076
1085
|
const [playlistsContents, contents] = await Promise.all([
|
|
1077
1086
|
playlistEngagedOnContents ? addContextToContent(fetchByRailContentIds, playlistEngagedOnContents, 'progress-tracker', {
|
|
1078
1087
|
addNextLesson: true,
|