musora-content-services 2.28.2 → 2.28.4
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 +9 -0
- package/docs/ContentOrganization.html +2 -2
- package/docs/Gamification.html +2 -2
- package/docs/UserManagementSystem.html +2 -2
- package/docs/api_types.js.html +2 -2
- package/docs/config.js.html +2 -2
- package/docs/content-org_content-org.js.html +2 -2
- package/docs/content-org_playlists-types.js.html +2 -2
- package/docs/content-org_playlists.js.html +2 -2
- package/docs/content.js.html +23 -16
- package/docs/gamification_awards.js.html +4 -522
- package/docs/gamification_gamification.js.html +2 -2
- package/docs/gamification_types.js.html +2 -2
- package/docs/global.html +2 -2
- package/docs/index.html +2 -2
- package/docs/module-Awards.html +2 -2
- package/docs/module-Config.html +2 -2
- package/docs/module-Content-Services-V2.html +9 -9
- package/docs/module-Interests.html +2 -2
- package/docs/module-Permissions.html +2 -2
- package/docs/module-Playlists.html +2 -2
- package/docs/module-Railcontent-Services.html +591 -2988
- package/docs/module-Sanity-Services.html +228 -680
- package/docs/module-Sessions.html +2 -2
- package/docs/module-UserActivity.html +50 -24
- package/docs/module-UserChat.html +2 -2
- package/docs/module-UserManagement.html +8 -8
- package/docs/module-UserNotifications.html +465 -21
- package/docs/module-UserProfile.html +106 -2
- package/docs/railcontent.js.html +13 -210
- package/docs/sanity.js.html +110 -256
- package/docs/userActivity.js.html +112 -88
- package/docs/user_chat.js.html +2 -2
- package/docs/user_interests.js.html +2 -2
- package/docs/user_management.js.html +5 -3
- package/docs/user_notifications.js.html +63 -15
- package/docs/user_permissions.js.html +2 -2
- package/docs/user_profile.js.html +18 -2
- package/docs/user_sessions.js.html +2 -2
- package/docs/user_types.js.html +2 -2
- package/docs/user_user-management-system.js.html +2 -2
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -24
- package/src/contentTypeConfig.js +2 -41
- package/src/index.d.ts +0 -30
- package/src/index.js +1 -31
- package/src/services/content.js +2 -2
- package/src/services/railcontent.js +5 -199
- package/src/services/sanity.js +3 -168
- package/src/services/userActivity.js +0 -1
- package/test/live/railcontentLive.test.js +0 -7
- package/test/sanityQueryService.test.js +3 -55
- package/.claude/settings.local.json +0 -8
- package/docs/Content-Organization.html +0 -245
- package/docs/UserManagement.html +0 -269
- package/docs/global.html#User +0 -293
- package/docs/module-Notifications.html +0 -1183
- package/docs/module-Session-Management.html +0 -575
- package/docs/module-User-Activity.html +0 -4410
- package/docs/module-User-Management.html +0 -490
- package/docs/module-User-Permissions.html +0 -406
- package/docs/types.js.html +0 -122
- package/docs/user_user-management.js.html +0 -78
package/docs/sanity.js.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Awards.html">Awards</a><ul class='methods'><li data-type='method'><a href="module-Awards.html#.fetchAwardsForUser">fetchAwardsForUser</a></li></ul></li><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#.initializeService">initializeService</a></li></ul></li><li><a href="module-Content-Services-V2.html">Content-Services-V2</a><ul class='methods'><li data-type='method'><a href="module-Content-Services-V2.html#.getContentRows">getContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getNewAndUpcoming">getNewAndUpcoming</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecent">getRecent</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecommendedForYou">getRecommendedForYou</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getScheduleContentRows">getScheduleContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getTabResults">getTabResults</a></li></ul></li><li><a href="module-Interests.html">Interests</a><ul class='methods'><li data-type='method'><a href="module-Interests.html#.fetchInterests">fetchInterests</a></li><li data-type='method'><a href="module-Interests.html#.fetchUninterests">fetchUninterests</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsInterested">markContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsNotInterested">markContentAsNotInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsInterested">removeContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsNotInterested">removeContentAsNotInterested</a></li></ul></li><li><a href="module-Permissions.html">Permissions</a><ul class='methods'><li data-type='method'><a href="module-Permissions.html#.fetchUserPermissions">fetchUserPermissions</a></li><li data-type='method'><a href="module-Permissions.html#.reset">reset</a></li></ul></li><li><a href="module-Playlists.html">Playlists</a><ul class='methods'><li data-type='method'><a href="module-Playlists.html#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Playlists.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Playlists.html#.togglePlaylistPrivate">togglePlaylistPrivate</a></li><li data-type='method'><a href="module-Playlists.html#.undeletePlaylist">undeletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~deleteItemsFromPlaylist">deleteItemsFromPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~reportPlaylist">reportPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~restoreItemFromPlaylist">restoreItemFromPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~unlikePlaylist">unlikePlaylist</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.assignModeratorToComment">assignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.closeComment">closeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createComment">createComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deleteComment">deleteComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.editComment">editComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCarouselCardData">fetchCarouselCardData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeIndexMetadata">fetchChallengeIndexMetadata</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeLessonData">fetchChallengeLessonData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeMetadata">fetchChallengeMetadata</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchChallengeUserActiveChallenges">fetchChallengeUserActiveChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComment">fetchComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCommentRelies">fetchCommentRelies</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComments">fetchComments</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedChallenges">fetchCompletedChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchNextContentDataForParent">fetchNextContentDataForParent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchOwnedChallenges">fetchOwnedChallenges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchRecentUserActivities">fetchRecentUserActivities</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchTopComment">fetchTopComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserAward">fetchUserAward</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserBadges">fetchUserBadges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserChallengeProgress">fetchUserChallengeProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPracticeNotes">fetchUserPracticeNotes</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likeComment">likeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.openComment">openComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesCommunityNotification">postChallengesCommunityNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnroll">postChallengesEnroll</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesEnrollmentNotification">postChallengesEnrollmentNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesHideCompletedBanner">postChallengesHideCompletedBanner</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesLeave">postChallengesLeave</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesSetStartDate">postChallengesSetStartDate</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesSoloNotification">postChallengesSoloNotification</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.postChallengesUnlock">postChallengesUnlock</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.replyToComment">replyToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.reportComment">reportComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.restoreComment">restoreComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.setStudentViewForUser">setStudentViewForUser</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unassignModeratorToComment">unassignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unlikeComment">unlikeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#~fetchLastInteractedChild">fetchLastInteractedChild</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchComingSoon">fetchComingSoon</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCommentModContentData">fetchCommentModContentData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLeaving">fetchLeaving</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonsFeaturingThisContent">fetchLessonsFeaturingThisContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchOtherSongVersions">fetchOtherSongVersions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentForDownload">fetchParentForDownload</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedRecommendedContent">fetchRelatedRecommendedContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchReturning">fetchReturning</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.jumpToContinueContent">jumpToContinueContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#~fetchRelatedByLicense">fetchRelatedByLicense</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getNextAndPreviousQuarterDates">getNextAndPreviousQuarterDates</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getQueryFromPage">getQueryFromPage</a></li><li data-type='method'><a href="module-Sanity-Services.html#~handleCustomFetchAll">handleCustomFetchAll</a></li></ul></li><li><a href="module-Sessions.html">Sessions</a><ul class='methods'><li data-type='method'><a href="module-Sessions.html#.login">login</a></li><li data-type='method'><a href="module-Sessions.html#.logout">logout</a></li></ul></li><li><a href="module-UserActivity.html">UserActivity</a><ul class='methods'><li data-type='method'><a href="module-UserActivity.html#.calculateLongestStreaks">calculateLongestStreaks</a></li><li data-type='method'><a href="module-UserActivity.html#.createPracticeNotes">createPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.deletePracticeSession">deletePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.deleteUserActivity">deleteUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeNotes">getPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeSessions">getPracticeSessions</a></li><li data-type='method'><a href="module-UserActivity.html#.getProgressRows">getProgressRows</a></li><li data-type='method'><a href="module-UserActivity.html#.getRecentActivity">getRecentActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserMonthlyStats">getUserMonthlyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserWeeklyStats">getUserWeeklyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.pinProgressRow">pinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserActivity">recordUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserPractice">recordUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.removeUserPractice">removeUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.restorePracticeSession">restorePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.restoreUserPractice">restoreUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.unpinProgressRow">unpinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.updatePracticeNotes">updatePracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.updateUserPractice">updateUserPractice</a></li></ul></li><li><a href="module-UserChat.html">UserChat</a><ul class='methods'><li data-type='method'><a href="module-UserChat.html#.fetchChatSettings">fetchChatSettings</a></li></ul></li><li><a href="module-UserManagement.html">UserManagement</a><ul class='methods'><li data-type='method'><a href="module-UserManagement.html#.blockUser">blockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.deletePicture">deletePicture</a></li><li data-type='method'><a href="module-UserManagement.html#.getUserData">getUserData</a></li><li data-type='method'><a href="module-UserManagement.html#.unblockUser">unblockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPicture">uploadPicture</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPictureFromS3">uploadPictureFromS3</a></li></ul></li><li><a href="module-UserNotifications.html">UserNotifications</a><ul class='methods'><li data-type='method'><a href="module-UserNotifications.html#.deleteNotification">deleteNotification</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotificationSettings">fetchNotificationSettings</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotifications">fetchNotifications</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchUnreadCount">fetchUnreadCount</a></li><li data-type='method'><a href="module-UserNotifications.html#.markAllNotificationsAsRead">markAllNotificationsAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsRead">markNotificationAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsUnread">markNotificationAsUnread</a></li><li data-type='method'><a href="module-UserNotifications.html#.updateNotificationSetting">updateNotificationSetting</a></li></ul></li><li><a href="module-UserProfile.html">UserProfile</a><ul class='methods'><li data-type='method'><a href="module-UserProfile.html#.otherStats">otherStats</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="ContentOrganization.html">ContentOrganization</a></li><li><a href="Gamification.html">Gamification</a></li><li><a href="UserManagementSystem.html">UserManagementSystem</a></li></ul><h3><a href="global.html">Global</a></h3>
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Awards.html">Awards</a><ul class='methods'><li data-type='method'><a href="module-Awards.html#.fetchAwardsForUser">fetchAwardsForUser</a></li></ul></li><li><a href="module-Config.html">Config</a><ul class='methods'><li data-type='method'><a href="module-Config.html#.initializeService">initializeService</a></li></ul></li><li><a href="module-Content-Services-V2.html">Content-Services-V2</a><ul class='methods'><li data-type='method'><a href="module-Content-Services-V2.html#.getContentRows">getContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getNewAndUpcoming">getNewAndUpcoming</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecent">getRecent</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getRecommendedForYou">getRecommendedForYou</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getScheduleContentRows">getScheduleContentRows</a></li><li data-type='method'><a href="module-Content-Services-V2.html#.getTabResults">getTabResults</a></li></ul></li><li><a href="module-Interests.html">Interests</a><ul class='methods'><li data-type='method'><a href="module-Interests.html#.fetchInterests">fetchInterests</a></li><li data-type='method'><a href="module-Interests.html#.fetchUninterests">fetchUninterests</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsInterested">markContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.markContentAsNotInterested">markContentAsNotInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsInterested">removeContentAsInterested</a></li><li data-type='method'><a href="module-Interests.html#.removeContentAsNotInterested">removeContentAsNotInterested</a></li></ul></li><li><a href="module-Permissions.html">Permissions</a><ul class='methods'><li data-type='method'><a href="module-Permissions.html#.fetchUserPermissions">fetchUserPermissions</a></li><li data-type='method'><a href="module-Permissions.html#.reset">reset</a></li></ul></li><li><a href="module-Playlists.html">Playlists</a><ul class='methods'><li data-type='method'><a href="module-Playlists.html#.addItemToPlaylist">addItemToPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.createPlaylist">createPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.deletePlaylist">deletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.duplicatePlaylist">duplicatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylist">fetchPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.fetchPlaylistItems">fetchPlaylistItems</a></li><li data-type='method'><a href="module-Playlists.html#.fetchUserPlaylists">fetchUserPlaylists</a></li><li data-type='method'><a href="module-Playlists.html#.togglePlaylistPrivate">togglePlaylistPrivate</a></li><li data-type='method'><a href="module-Playlists.html#.undeletePlaylist">undeletePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#.updatePlaylist">updatePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~deleteItemsFromPlaylist">deleteItemsFromPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~likePlaylist">likePlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~reportPlaylist">reportPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~restoreItemFromPlaylist">restoreItemFromPlaylist</a></li><li data-type='method'><a href="module-Playlists.html#~unlikePlaylist">unlikePlaylist</a></li></ul></li><li><a href="module-Railcontent-Services.html">Railcontent-Services</a><ul class='methods'><li data-type='method'><a href="module-Railcontent-Services.html#.assignModeratorToComment">assignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.closeComment">closeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.createComment">createComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.deleteComment">deleteComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.editComment">editComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchAllCompletedStates">fetchAllCompletedStates</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCarouselCardData">fetchCarouselCardData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComment">fetchComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCommentRelies">fetchCommentRelies</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchComments">fetchComments</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedContent">fetchCompletedContent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchCompletedState">fetchCompletedState</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentInProgress">fetchContentInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchContentPageUserData">fetchContentPageUserData</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchNextContentDataForParent">fetchNextContentDataForParent</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchRecentUserActivities">fetchRecentUserActivities</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchSongsInProgress">fetchSongsInProgress</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchTopComment">fetchTopComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserAward">fetchUserAward</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserBadges">fetchUserBadges</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.fetchUserPracticeNotes">fetchUserPracticeNotes</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.likeComment">likeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.openComment">openComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.replyToComment">replyToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.reportComment">reportComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.restoreComment">restoreComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.setStudentViewForUser">setStudentViewForUser</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unassignModeratorToComment">unassignModeratorToComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#.unlikeComment">unlikeComment</a></li><li data-type='method'><a href="module-Railcontent-Services.html#~fetchLastInteractedChild">fetchLastInteractedChild</a></li></ul></li><li><a href="module-Sanity-Services.html">Sanity-Services</a><ul class='methods'><li data-type='method'><a href="module-Sanity-Services.html#.fetchAll">fetchAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllFilterOptions">fetchAllFilterOptions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchAllPacks">fetchAllPacks</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtistLessons">fetchArtistLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchArtists">fetchArtists</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentId">fetchByRailContentId</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByRailContentIds">fetchByRailContentIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchByReference">fetchByReference</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCoachLessons">fetchCoachLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchComingSoon">fetchComingSoon</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchCommentModContentData">fetchCommentModContentData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchFoundation">fetchFoundation</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchGenreLessons">fetchGenreLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLeaving">fetchLeaving</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonContent">fetchLessonContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchLessonsFeaturingThisContent">fetchLessonsFeaturingThisContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMetadata">fetchMetadata</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethod">fetchMethod</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildren">fetchMethodChildren</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodChildrenIds">fetchMethodChildrenIds</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchMethodPreviousNextLesson">fetchMethodPreviousNextLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNewReleases">fetchNewReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchNextPreviousLesson">fetchNextPreviousLesson</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchOtherSongVersions">fetchOtherSongVersions</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackAll">fetchPackAll</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchPackData">fetchPackData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchParentForDownload">fetchParentForDownload</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedLessons">fetchRelatedLessons</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedRecommendedContent">fetchRelatedRecommendedContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchRelatedSongs">fetchRelatedSongs</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchReturning">fetchReturning</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSanity">fetchSanity</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchScheduledReleases">fetchScheduledReleases</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchShowsData">fetchShowsData</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSiblingContent">fetchSiblingContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongArtistCount">fetchSongArtistCount</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchSongById">fetchSongById</a></li><li data-type='method'><a href="module-Sanity-Services.html#.fetchUpcomingEvents">fetchUpcomingEvents</a></li><li data-type='method'><a href="module-Sanity-Services.html#.jumpToContinueContent">jumpToContinueContent</a></li><li data-type='method'><a href="module-Sanity-Services.html#~fetchRelatedByLicense">fetchRelatedByLicense</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getNextAndPreviousQuarterDates">getNextAndPreviousQuarterDates</a></li><li data-type='method'><a href="module-Sanity-Services.html#~getQueryFromPage">getQueryFromPage</a></li></ul></li><li><a href="module-Sessions.html">Sessions</a><ul class='methods'><li data-type='method'><a href="module-Sessions.html#.login">login</a></li><li data-type='method'><a href="module-Sessions.html#.logout">logout</a></li></ul></li><li><a href="module-UserActivity.html">UserActivity</a><ul class='methods'><li data-type='method'><a href="module-UserActivity.html#.calculateLongestStreaks">calculateLongestStreaks</a></li><li data-type='method'><a href="module-UserActivity.html#.createPracticeNotes">createPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.deletePracticeSession">deletePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.deleteUserActivity">deleteUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeNotes">getPracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.getPracticeSessions">getPracticeSessions</a></li><li data-type='method'><a href="module-UserActivity.html#.getProgressRows">getProgressRows</a></li><li data-type='method'><a href="module-UserActivity.html#.getRecentActivity">getRecentActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserMonthlyStats">getUserMonthlyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.getUserWeeklyStats">getUserWeeklyStats</a></li><li data-type='method'><a href="module-UserActivity.html#.pinProgressRow">pinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserActivity">recordUserActivity</a></li><li data-type='method'><a href="module-UserActivity.html#.recordUserPractice">recordUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.removeUserPractice">removeUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.restorePracticeSession">restorePracticeSession</a></li><li data-type='method'><a href="module-UserActivity.html#.restoreUserPractice">restoreUserPractice</a></li><li data-type='method'><a href="module-UserActivity.html#.unpinProgressRow">unpinProgressRow</a></li><li data-type='method'><a href="module-UserActivity.html#.updatePracticeNotes">updatePracticeNotes</a></li><li data-type='method'><a href="module-UserActivity.html#.updateUserPractice">updateUserPractice</a></li></ul></li><li><a href="module-UserChat.html">UserChat</a><ul class='methods'><li data-type='method'><a href="module-UserChat.html#.fetchChatSettings">fetchChatSettings</a></li></ul></li><li><a href="module-UserManagement.html">UserManagement</a><ul class='methods'><li data-type='method'><a href="module-UserManagement.html#.blockUser">blockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.deletePicture">deletePicture</a></li><li data-type='method'><a href="module-UserManagement.html#.getUserData">getUserData</a></li><li data-type='method'><a href="module-UserManagement.html#.unblockUser">unblockUser</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPicture">uploadPicture</a></li><li data-type='method'><a href="module-UserManagement.html#.uploadPictureFromS3">uploadPictureFromS3</a></li></ul></li><li><a href="module-UserNotifications.html">UserNotifications</a><ul class='methods'><li data-type='method'><a href="module-UserNotifications.html#.deleteNotification">deleteNotification</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchLiveEventPollingState">fetchLiveEventPollingState</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotificationSettings">fetchNotificationSettings</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchNotifications">fetchNotifications</a></li><li data-type='method'><a href="module-UserNotifications.html#.fetchUnreadCount">fetchUnreadCount</a></li><li data-type='method'><a href="module-UserNotifications.html#.markAllNotificationsAsRead">markAllNotificationsAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsRead">markNotificationAsRead</a></li><li data-type='method'><a href="module-UserNotifications.html#.markNotificationAsUnread">markNotificationAsUnread</a></li><li data-type='method'><a href="module-UserNotifications.html#.pauseLiveEventPolling">pauseLiveEventPolling</a></li><li data-type='method'><a href="module-UserNotifications.html#.startLiveEventPolling">startLiveEventPolling</a></li><li data-type='method'><a href="module-UserNotifications.html#.updateNotificationSetting">updateNotificationSetting</a></li></ul></li><li><a href="module-UserProfile.html">UserProfile</a><ul class='methods'><li data-type='method'><a href="module-UserProfile.html#.deleteProfilePicture">deleteProfilePicture</a></li><li data-type='method'><a href="module-UserProfile.html#.otherStats">otherStats</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="ContentOrganization.html">ContentOrganization</a></li><li><a href="Gamification.html">Gamification</a></li><li><a href="UserManagementSystem.html">UserManagementSystem</a></li></ul><h3><a href="global.html">Global</a></h3>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
*/
|
|
51
51
|
import {
|
|
52
52
|
artistOrInstructorName,
|
|
53
|
+
instructorField,
|
|
54
|
+
chapterField,
|
|
53
55
|
assignmentsField,
|
|
54
56
|
descriptionField,
|
|
55
57
|
resourcesField,
|
|
@@ -70,21 +72,20 @@ import { processMetadata, typeWithSortOrder } from '../contentMetaData.js'
|
|
|
70
72
|
import { globalConfig } from './config.js'
|
|
71
73
|
|
|
72
74
|
import {
|
|
73
|
-
fetchCompletedChallenges,
|
|
74
|
-
fetchOwnedChallenges,
|
|
75
75
|
fetchNextContentDataForParent,
|
|
76
76
|
fetchHandler,
|
|
77
77
|
} from './railcontent.js'
|
|
78
78
|
import { arrayToStringRepresentation, FilterBuilder } from '../filterBuilder.js'
|
|
79
79
|
import { fetchUserPermissions } from './user/permissions.js'
|
|
80
80
|
import { getAllCompleted, getAllStarted, getAllStartedOrCompleted } from './contentProgress.js'
|
|
81
|
+
import {fetchRecentActivitiesActiveTabs} from "./userActivity.js";
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
84
|
* Exported functions that are excluded from index generation.
|
|
84
85
|
*
|
|
85
86
|
* @type {string[]}
|
|
86
87
|
*/
|
|
87
|
-
const excludeFromGeneratedIndex = ['
|
|
88
|
+
const excludeFromGeneratedIndex = ['fetchRelatedByLicense']
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
91
|
* Fetch a song by its document ID from Sanity.
|
|
@@ -120,18 +121,19 @@ export async function fetchSongById(documentId) {
|
|
|
120
121
|
* @returns {Promise<Object|null>}
|
|
121
122
|
*/
|
|
122
123
|
export async function fetchLeaving(brand, { pageNumber = 1, contentPerPage = 20 } = {}) {
|
|
123
|
-
const
|
|
124
|
-
const
|
|
124
|
+
const today = new Date()
|
|
125
|
+
const isoDateOnly = today.toISOString().split('T')[0]
|
|
126
|
+
const filterString = `brand == '${brand}' && quarter_removed > '${isoDateOnly}'`
|
|
125
127
|
const startEndOrder = getQueryFromPage(pageNumber, contentPerPage)
|
|
126
128
|
const sortOrder = {
|
|
127
|
-
sortOrder: 'published_on desc, id desc',
|
|
129
|
+
sortOrder: 'quarter_removed asc, published_on desc, id desc',
|
|
128
130
|
start: startEndOrder['start'],
|
|
129
131
|
end: startEndOrder['end'],
|
|
130
132
|
}
|
|
131
133
|
const query = await buildQuery(
|
|
132
134
|
filterString,
|
|
133
135
|
{ pullFutureContent: false, availableContentStatuses: ['published'] },
|
|
134
|
-
getFieldsForContentType(),
|
|
136
|
+
getFieldsForContentType('leaving'),
|
|
135
137
|
sortOrder
|
|
136
138
|
)
|
|
137
139
|
return fetchSanity(query, true)
|
|
@@ -146,11 +148,12 @@ export async function fetchLeaving(brand, { pageNumber = 1, contentPerPage = 20
|
|
|
146
148
|
* @returns {Promise<Object|null>}
|
|
147
149
|
*/
|
|
148
150
|
export async function fetchReturning(brand, { pageNumber = 1, contentPerPage = 20 } = {}) {
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
+
const today = new Date()
|
|
152
|
+
const isoDateOnly = today.toISOString().split('T')[0]
|
|
153
|
+
const filterString = `brand == '${brand}' && quarter_published >= '${isoDateOnly}'`
|
|
151
154
|
const startEndOrder = getQueryFromPage(pageNumber, contentPerPage)
|
|
152
155
|
const sortOrder = {
|
|
153
|
-
sortOrder: 'published_on desc, id desc',
|
|
156
|
+
sortOrder: 'quarter_published asc, published_on desc, id desc',
|
|
154
157
|
start: startEndOrder['start'],
|
|
155
158
|
end: startEndOrder['end'],
|
|
156
159
|
}
|
|
@@ -395,7 +398,7 @@ export async function fetchNewReleases(
|
|
|
395
398
|
const end = start + limit
|
|
396
399
|
const sortOrder = getSortOrder(sort, brand)
|
|
397
400
|
const nextQuarter = getNextAndPreviousQuarterDates()['next']
|
|
398
|
-
const filter = `_type in ${typesString} && brand == '${brand}' && show_in_new_feed == true && (!defined(quarter_published) || quarter_published != '${nextQuarter}')`
|
|
401
|
+
const filter = `_type in ${typesString} && brand == '${brand}' && status == 'published' && show_in_new_feed == true && (!defined(quarter_published) || quarter_published != '${nextQuarter}')`
|
|
399
402
|
const fields = `
|
|
400
403
|
"id": railcontent_id,
|
|
401
404
|
title,
|
|
@@ -565,13 +568,30 @@ export async function fetchByRailContentIds(ids, contentType = undefined, brand
|
|
|
565
568
|
}
|
|
566
569
|
const idsString = ids.join(',')
|
|
567
570
|
const brandFilter = brand ? ` && brand == "${brand}"` : ''
|
|
571
|
+
const now = getSanityDate(new Date())
|
|
568
572
|
const query = `*[
|
|
569
573
|
railcontent_id in [${idsString}]${brandFilter}
|
|
570
574
|
]{
|
|
571
575
|
${getFieldsForContentType(contentType)}
|
|
576
|
+
live_event_start_time,
|
|
577
|
+
live_event_end_time,
|
|
572
578
|
}`
|
|
573
579
|
|
|
574
|
-
const
|
|
580
|
+
const customPostProcess = (results) => {
|
|
581
|
+
const now = getSanityDate(new Date(), false);
|
|
582
|
+
const liveProcess = (result) => {
|
|
583
|
+
if (result.live_event_start_time && result.live_event_end_time) {
|
|
584
|
+
result.isLive =
|
|
585
|
+
result.live_event_start_time <= now &&
|
|
586
|
+
result.live_event_end_time >= now;
|
|
587
|
+
} else {
|
|
588
|
+
result.isLive = false;
|
|
589
|
+
}
|
|
590
|
+
return result;
|
|
591
|
+
};
|
|
592
|
+
return results.map(liveProcess);
|
|
593
|
+
}
|
|
594
|
+
const results = await fetchSanity(query, true, { customPostProcess: customPostProcess })
|
|
575
595
|
|
|
576
596
|
const sortFuction = function compare(a, b) {
|
|
577
597
|
const indexA = ids.indexOf(a['id'])
|
|
@@ -596,7 +616,10 @@ export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
|
596
616
|
brand,
|
|
597
617
|
name,
|
|
598
618
|
'slug': slug.current,
|
|
599
|
-
'content': content[]->{
|
|
619
|
+
'content': content[]->{
|
|
620
|
+
'children': child[]->{ 'id': railcontent_id, 'children': child[]->{'id': railcontent_id}, },
|
|
621
|
+
${getFieldsForContentType('tab-data')}
|
|
622
|
+
},
|
|
600
623
|
}`, true)
|
|
601
624
|
}
|
|
602
625
|
|
|
@@ -650,21 +673,6 @@ export async function fetchAll(
|
|
|
650
673
|
progress = 'all',
|
|
651
674
|
} = {}
|
|
652
675
|
) {
|
|
653
|
-
let customResults = await handleCustomFetchAll(brand, type, {
|
|
654
|
-
page,
|
|
655
|
-
limit,
|
|
656
|
-
searchTerm,
|
|
657
|
-
sort,
|
|
658
|
-
includedFields,
|
|
659
|
-
groupBy,
|
|
660
|
-
progressIds,
|
|
661
|
-
useDefaultFields,
|
|
662
|
-
customFields,
|
|
663
|
-
progress,
|
|
664
|
-
})
|
|
665
|
-
if (customResults) {
|
|
666
|
-
return customResults
|
|
667
|
-
}
|
|
668
676
|
let config = contentTypeConfig[type] ?? {}
|
|
669
677
|
let additionalFields = config?.fields ?? []
|
|
670
678
|
let isGroupByOneToOne = (groupBy ? config?.relationships?.[groupBy]?.isOneToOne : false) ?? false
|
|
@@ -687,9 +695,7 @@ export async function fetchAll(
|
|
|
687
695
|
} else {
|
|
688
696
|
typeFilter = type
|
|
689
697
|
? `&& _type == '${type}'`
|
|
690
|
-
:
|
|
691
|
-
? " && (_type != 'challenge-part' && _type != 'challenge')"
|
|
692
|
-
: ''
|
|
698
|
+
: ''
|
|
693
699
|
}
|
|
694
700
|
|
|
695
701
|
// Construct the search filter
|
|
@@ -787,152 +793,6 @@ export async function fetchAll(
|
|
|
787
793
|
return fetchSanity(query, true)
|
|
788
794
|
}
|
|
789
795
|
|
|
790
|
-
/**
|
|
791
|
-
* Fetch all content that requires custom handling or a distinct external call
|
|
792
|
-
* @param {string} brand - The brand for which to fetch content.
|
|
793
|
-
* @param {string} type - The content type to fetch (e.g., 'song', 'artist').
|
|
794
|
-
* @param {Object} params - Parameters for pagination, filtering, sorting, and grouping.
|
|
795
|
-
* @param {number} [params.page=1] - The page number for pagination.
|
|
796
|
-
* @param {number} [params.limit=10] - The number of items per page.
|
|
797
|
-
* @param {string} [params.searchTerm=""] - The search term to filter content by title or artist.
|
|
798
|
-
* @param {string} [params.sort="-published_on"] - The field to sort the content by.
|
|
799
|
-
* @param {Array<string>} [params.includedFields=[]] - The fields to include in the query.
|
|
800
|
-
* @param {string} [params.groupBy=""] - The field to group the results by (e.g., 'artist', 'genre').
|
|
801
|
-
* @param {Array<string>} [params.progressIds=undefined] - An array of railcontent IDs to filter the results by. Used for filtering by progress.
|
|
802
|
-
* @param {boolean} [params.useDefaultFields=true] - use the default sanity fields for content Type
|
|
803
|
-
* @param {Array<string>} [params.customFields=[]] - An array of sanity fields to include in the request
|
|
804
|
-
* @param {string} [params.progress="all"] - An string representing which progress filter to use ("all", "in progress", "complete", "not started").
|
|
805
|
-
* @returns {Promise<Object|null>} - The fetched content data or null if not found.
|
|
806
|
-
*/
|
|
807
|
-
async function handleCustomFetchAll(
|
|
808
|
-
brand,
|
|
809
|
-
type,
|
|
810
|
-
{
|
|
811
|
-
page = 1,
|
|
812
|
-
limit = 10,
|
|
813
|
-
searchTerm = '',
|
|
814
|
-
sort = '-published_on',
|
|
815
|
-
includedFields = [],
|
|
816
|
-
groupBy = '',
|
|
817
|
-
progressIds = undefined,
|
|
818
|
-
useDefaultFields = true,
|
|
819
|
-
customFields = [],
|
|
820
|
-
progress = 'all',
|
|
821
|
-
} = {}
|
|
822
|
-
) {
|
|
823
|
-
if (type === 'challenge') {
|
|
824
|
-
if (groupBy === 'completed') {
|
|
825
|
-
const completedIds = await fetchCompletedChallenges(brand, page, limit)
|
|
826
|
-
return fetchAll(brand, type, {
|
|
827
|
-
page,
|
|
828
|
-
limit,
|
|
829
|
-
searchTerm,
|
|
830
|
-
sort,
|
|
831
|
-
includedFields,
|
|
832
|
-
groupBy: '',
|
|
833
|
-
progressIds: completedIds,
|
|
834
|
-
useDefaultFields,
|
|
835
|
-
customFields,
|
|
836
|
-
progress,
|
|
837
|
-
})
|
|
838
|
-
} else if (groupBy === 'owned') {
|
|
839
|
-
const ownedIds = await fetchOwnedChallenges(brand, page, limit)
|
|
840
|
-
return fetchAll(brand, type, {
|
|
841
|
-
page,
|
|
842
|
-
limit,
|
|
843
|
-
searchTerm,
|
|
844
|
-
sort,
|
|
845
|
-
includedFields,
|
|
846
|
-
groupBy: '',
|
|
847
|
-
progressIds: ownedIds,
|
|
848
|
-
useDefaultFields,
|
|
849
|
-
customFields,
|
|
850
|
-
progress,
|
|
851
|
-
})
|
|
852
|
-
} else if (groupBy === 'difficulty_string') {
|
|
853
|
-
return fetchChallengesByDifficulty(
|
|
854
|
-
brand,
|
|
855
|
-
type,
|
|
856
|
-
page,
|
|
857
|
-
limit,
|
|
858
|
-
searchTerm,
|
|
859
|
-
sort,
|
|
860
|
-
includedFields,
|
|
861
|
-
groupBy,
|
|
862
|
-
progressIds,
|
|
863
|
-
useDefaultFields,
|
|
864
|
-
customFields,
|
|
865
|
-
progress
|
|
866
|
-
)
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
return null
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
async function fetchChallengesByDifficulty(
|
|
873
|
-
brand,
|
|
874
|
-
type,
|
|
875
|
-
page,
|
|
876
|
-
limit,
|
|
877
|
-
searchTerm,
|
|
878
|
-
sort,
|
|
879
|
-
includedFields,
|
|
880
|
-
groupBy,
|
|
881
|
-
progressIds,
|
|
882
|
-
useDefaultFields,
|
|
883
|
-
customFields,
|
|
884
|
-
progress
|
|
885
|
-
) {
|
|
886
|
-
let config = contentTypeConfig['challenge'] ?? {}
|
|
887
|
-
let additionalFields = config?.fields ?? []
|
|
888
|
-
|
|
889
|
-
// Construct the search filter
|
|
890
|
-
const searchFilter = searchTerm
|
|
891
|
-
? groupBy !== ''
|
|
892
|
-
? `&& (^.name match "${searchTerm}*" || title match "${searchTerm}*")`
|
|
893
|
-
: `&& (artist->name match "${searchTerm}*" || instructor[]->name match "${searchTerm}*" || title match "${searchTerm}*" || name match "${searchTerm}*")`
|
|
894
|
-
: ''
|
|
895
|
-
|
|
896
|
-
// Construct the included fields filter, replacing 'difficulty' with 'difficulty_string'
|
|
897
|
-
const includedFieldsFilter = includedFields.length > 0 ? filtersToGroq(includedFields) : ''
|
|
898
|
-
|
|
899
|
-
// limits the results to supplied progressIds for started & completed filters
|
|
900
|
-
const progressFilter = await getProgressFilter(progress, progressIds)
|
|
901
|
-
|
|
902
|
-
let fields = useDefaultFields
|
|
903
|
-
? customFields.concat(DEFAULT_FIELDS, additionalFields)
|
|
904
|
-
: customFields
|
|
905
|
-
let fieldsString = fields.join(',')
|
|
906
|
-
|
|
907
|
-
const lessonsFilter = `_type == 'challenge' && brand == '${brand}' && ^.name == difficulty_string ${searchFilter} ${includedFieldsFilter} ${progressFilter}`
|
|
908
|
-
const lessonsFilterWithRestrictions = await new FilterBuilder(lessonsFilter).buildFilter()
|
|
909
|
-
|
|
910
|
-
const query = `{
|
|
911
|
-
"entity": [
|
|
912
|
-
{"name": "All"},
|
|
913
|
-
{"name": "Novice"},
|
|
914
|
-
{"name": "Beginner"},
|
|
915
|
-
{"name": "Intermediate"},
|
|
916
|
-
{"name": "Advanced"},
|
|
917
|
-
{"name": "Expert"}]
|
|
918
|
-
{
|
|
919
|
-
'id': 0,
|
|
920
|
-
name,
|
|
921
|
-
'all_lessons_count': count(*[${lessonsFilterWithRestrictions}]._id),
|
|
922
|
-
'lessons': *[${lessonsFilterWithRestrictions}]{
|
|
923
|
-
${fieldsString},
|
|
924
|
-
name
|
|
925
|
-
}[0...20]
|
|
926
|
-
},
|
|
927
|
-
"total": 0
|
|
928
|
-
}`
|
|
929
|
-
let data = await fetchSanity(query, true)
|
|
930
|
-
data.entity = data.entity.filter(function (difficulty) {
|
|
931
|
-
return difficulty.lessons.length > 0
|
|
932
|
-
})
|
|
933
|
-
return data
|
|
934
|
-
}
|
|
935
|
-
|
|
936
796
|
async function getProgressFilter(progress, progressIds) {
|
|
937
797
|
switch (progress) {
|
|
938
798
|
case 'all':
|
|
@@ -1318,41 +1178,16 @@ export async function jumpToContinueContent(railcontentId) {
|
|
|
1318
1178
|
*/
|
|
1319
1179
|
export async function fetchLessonContent(railContentId) {
|
|
1320
1180
|
const filterParams = { isSingle: true, pullFutureContent: true }
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
// If you're unsure, message Adrian, or just add them.
|
|
1324
|
-
const fields = `title,
|
|
1325
|
-
published_on,
|
|
1326
|
-
"type":_type,
|
|
1181
|
+
|
|
1182
|
+
const fields = `${getFieldsForContentType()}
|
|
1327
1183
|
"resources": ${resourcesField},
|
|
1328
|
-
difficulty,
|
|
1329
|
-
difficulty_string,
|
|
1330
|
-
brand,
|
|
1331
|
-
status,
|
|
1332
1184
|
soundslice,
|
|
1333
1185
|
instrumentless,
|
|
1334
|
-
railcontent_id,
|
|
1335
|
-
"id":railcontent_id,
|
|
1336
|
-
slug, artist->,
|
|
1337
|
-
"thumbnail":thumbnail.asset->url,
|
|
1338
1186
|
soundslice_slug,
|
|
1339
|
-
"description":
|
|
1340
|
-
"chapters":
|
|
1341
|
-
chapter_description,
|
|
1342
|
-
chapter_timecode,
|
|
1343
|
-
"chapter_thumbnail_url": chapter_thumbnail_url.asset->url
|
|
1344
|
-
},
|
|
1345
|
-
'artist': { 'name': artist->name, 'thumbnail': artist->thumbnail_url.asset->url},
|
|
1187
|
+
"description": ${descriptionField},
|
|
1188
|
+
"chapters": ${chapterField},
|
|
1346
1189
|
"instructors":instructor[]->name,
|
|
1347
|
-
"instructor":
|
|
1348
|
-
"id":railcontent_id,
|
|
1349
|
-
name,
|
|
1350
|
-
short_bio,
|
|
1351
|
-
"biography": short_bio[0].children[0].text,
|
|
1352
|
-
web_url_path,
|
|
1353
|
-
"coach_card_image": coach_card_image.asset->url,
|
|
1354
|
-
"coach_profile_image":thumbnail_url.asset->url
|
|
1355
|
-
},
|
|
1190
|
+
"instructor": ${instructorField},
|
|
1356
1191
|
${assignmentsField}
|
|
1357
1192
|
video,
|
|
1358
1193
|
length_in_seconds,
|
|
@@ -1370,9 +1205,6 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1370
1205
|
"dark_mode_logo": *[railcontent_id == ^.id][0].dark_mode_logo_url.asset->url,
|
|
1371
1206
|
"light_mode_logo": *[railcontent_id == ^.id][0].light_mode_logo_url.asset->url,
|
|
1372
1207
|
},
|
|
1373
|
-
sort,
|
|
1374
|
-
xp,
|
|
1375
|
-
stbs,ds2stbs, bdsStbs,
|
|
1376
1208
|
...select(
|
|
1377
1209
|
defined(live_event_start_time) => {
|
|
1378
1210
|
"live_event_start_time": live_event_start_time,
|
|
@@ -1385,6 +1217,7 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1385
1217
|
const query = await buildQuery(`railcontent_id == ${railContentId}`, filterParams, fields, {
|
|
1386
1218
|
isSingle: true,
|
|
1387
1219
|
})
|
|
1220
|
+
console.log('query', query)
|
|
1388
1221
|
const chapterProcess = (result) => {
|
|
1389
1222
|
const now = getSanityDate(new Date(), false)
|
|
1390
1223
|
if (result.live_event_start_time && result.live_event_end_time) {
|
|
@@ -1396,6 +1229,7 @@ export async function fetchLessonContent(railContentId) {
|
|
|
1396
1229
|
...chapter,
|
|
1397
1230
|
chapter_thumbnail_url: `https://musora-web-platform.s3.amazonaws.com/chapters/${result.brand}/Chapter${index + 1}.jpg`,
|
|
1398
1231
|
}))
|
|
1232
|
+
console.log('result', result)
|
|
1399
1233
|
return result
|
|
1400
1234
|
}
|
|
1401
1235
|
|
|
@@ -1459,7 +1293,8 @@ export async function fetchLessonsFeaturingThisContent(railcontentId, brand, cou
|
|
|
1459
1293
|
*/
|
|
1460
1294
|
async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, count) {
|
|
1461
1295
|
const typeCheck = `@->_type in [${arrayJoinWithQuotes(SONG_TYPES)}]`
|
|
1462
|
-
|
|
1296
|
+
let typeCheckString = `@->brand == '${brand}' && `
|
|
1297
|
+
typeCheckString += onlyUseSongTypes ? `${typeCheck}` : `!(${typeCheck})`
|
|
1463
1298
|
const contentFromLicenseFilter = `_type == 'license' && references(^._id)].content[${typeCheckString} && @->railcontent_id != ${railcontentId}`
|
|
1464
1299
|
let filterSongTypesWithSameLicense = await new FilterBuilder(contentFromLicenseFilter, {
|
|
1465
1300
|
isChildrenFilter: true,
|
|
@@ -1476,13 +1311,55 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1476
1311
|
"related_by_license" :
|
|
1477
1312
|
*[${filterSongTypesWithSameLicense}]->{${queryFields}}|order(published_on desc, title asc)[0...${count}],
|
|
1478
1313
|
}[0...1]`
|
|
1479
|
-
|
|
1480
1314
|
const results = await fetchSanity(query, false)
|
|
1481
1315
|
return results['related_by_license'] ?? []
|
|
1482
1316
|
}
|
|
1483
1317
|
|
|
1484
1318
|
/**
|
|
1485
|
-
* Fetch
|
|
1319
|
+
* Fetch sibling lessons to a specific lesson
|
|
1320
|
+
* @param {string} railContentId - The RailContent ID of the current lesson.
|
|
1321
|
+
* @param {string} brand - The current brand.
|
|
1322
|
+
* @returns {Promise<Array<Object>|null>} - The fetched related lessons data or null if not found.
|
|
1323
|
+
*/
|
|
1324
|
+
export async function fetchSiblingContent(railContentId, brand)
|
|
1325
|
+
{
|
|
1326
|
+
const filterGetParent = await new FilterBuilder(`references(^._id) && _type == ^.parent_type`, {
|
|
1327
|
+
pullFutureContent: true,
|
|
1328
|
+
}).buildFilter()
|
|
1329
|
+
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
1330
|
+
|
|
1331
|
+
const queryFields = `_id, "id":railcontent_id, published_on, "instructor": instructor[0]->name, title, "thumbnail":thumbnail.asset->url, length_in_seconds, status, "type": _type, difficulty, difficulty_string, artist->, "permission_id": permission[]->railcontent_id, "genre": genre[]->name, "parent_id": parent_content_data[0].id`
|
|
1332
|
+
|
|
1333
|
+
const query = `*[railcontent_id == ${railContentId} && brand == "${brand}"]{
|
|
1334
|
+
_type, parent_type, 'parent_id': parent_content_data[0].id, railcontent_id,
|
|
1335
|
+
'for-calculations': *[${filterGetParent}][0]{
|
|
1336
|
+
'siblings-list': child[]->railcontent_id,
|
|
1337
|
+
'parents-list': *[${filterGetParent}][0].child[]->railcontent_id
|
|
1338
|
+
},
|
|
1339
|
+
"related_lessons" : *[${filterGetParent}][0].child[${childrenFilter}]->{${queryFields}}
|
|
1340
|
+
}`
|
|
1341
|
+
|
|
1342
|
+
let result = await fetchSanity(query, false)
|
|
1343
|
+
|
|
1344
|
+
//there's no way in sanity to retrieve the index of an array, so we must calculate after fetch
|
|
1345
|
+
if (result['for-calculations'] && result['for-calculations']['parents-list']) {
|
|
1346
|
+
const calc = result['for-calculations']
|
|
1347
|
+
const parentCount = calc['parents-list'].length
|
|
1348
|
+
const currentParentIndex = calc['parents-list'].indexOf(result['parent_id']) + 1
|
|
1349
|
+
const siblingCount = calc['siblings-list'].length
|
|
1350
|
+
const currentSiblingIndex = calc['siblings-list'].indexOf(result['railcontent_id']) + 1
|
|
1351
|
+
|
|
1352
|
+
delete result['for-calculations']
|
|
1353
|
+
result = { ...result, parentCount, currentParentIndex, siblingCount, currentSiblingIndex }
|
|
1354
|
+
return result
|
|
1355
|
+
} else {
|
|
1356
|
+
delete result['for-calculations']
|
|
1357
|
+
return result
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* Fetch lessons related to a specific lesson by RailContent ID and type.
|
|
1486
1363
|
* @param {string} railContentId - The RailContent ID of the current lesson.
|
|
1487
1364
|
* @param {string} brand - The current brand.
|
|
1488
1365
|
* @returns {Promise<Array<Object>|null>} - The fetched related lessons data or null if not found.
|
|
@@ -1500,43 +1377,18 @@ export async function fetchRelatedLessons(railContentId, brand) {
|
|
|
1500
1377
|
const filterSongSameGenre = await new FilterBuilder(
|
|
1501
1378
|
`_type=="song" && _type==^._type && brand == "${brand}" && references(^.genre[]->_id) && railcontent_id !=${railContentId}`
|
|
1502
1379
|
).buildFilter()
|
|
1503
|
-
const filterNeighbouringSiblings = await new FilterBuilder(`references(^._id)`, {
|
|
1504
|
-
pullFutureContent: true,
|
|
1505
|
-
}).buildFilter()
|
|
1506
|
-
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
1507
1380
|
const queryFields = `_id, "id":railcontent_id, published_on, "instructor": instructor[0]->name, title, "thumbnail":thumbnail.asset->url, length_in_seconds, status, "type": _type, difficulty, difficulty_string, railcontent_id, artist->,"permission_id": permission[]->railcontent_id,_type, "genre": genre[]->name`
|
|
1508
1381
|
const queryFieldsWithSort = queryFields + ', sort'
|
|
1509
1382
|
const query = `*[railcontent_id == ${railContentId} && brand == "${brand}" && (!defined(permission) || references(*[_type=='permission']._id))]{
|
|
1510
|
-
_type, parent_type,
|
|
1511
|
-
'for-calculations': *[references(^._id) && !(_type in ['license'])][0]{
|
|
1512
|
-
'siblings-list': child[]->railcontent_id,
|
|
1513
|
-
'parents-list': *[references(^._id)][0].child[]->railcontent_id
|
|
1514
|
-
},
|
|
1383
|
+
_type, parent_type, railcontent_id,
|
|
1515
1384
|
"related_lessons" : array::unique([
|
|
1516
|
-
...(*[${filterNeighbouringSiblings}][0].child[${childrenFilter}]->{${queryFields}}),
|
|
1517
1385
|
...(*[${filterSongSameArtist}]{${queryFields}}|order(published_on desc, title asc)[0...10]),
|
|
1518
1386
|
...(*[${filterSongSameGenre}]{${queryFields}}|order(published_on desc, title asc)[0...10]),
|
|
1519
1387
|
...(*[${filterSameTypeAndSortOrder}]{${queryFieldsWithSort}}|order(sort asc, title asc)[0...10]),
|
|
1520
1388
|
...(*[${filterSameType}]{${queryFields}}|order(published_on desc, title asc)[0...10])
|
|
1521
1389
|
,
|
|
1522
1390
|
])[0...10]}`
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
//there's no way in sanity to retrieve the index of an array, so we must calculate after fetch
|
|
1526
|
-
if (result['for-calculations'] && result['for-calculations']['parents-list']) {
|
|
1527
|
-
const calc = result['for-calculations']
|
|
1528
|
-
const parentCount = calc['parents-list'].length
|
|
1529
|
-
const currentParent = calc['parents-list'].indexOf(result['parent_id']) + 1
|
|
1530
|
-
const siblingCount = calc['siblings-list'].length
|
|
1531
|
-
const currentSibling = calc['siblings-list'].indexOf(result['railcontent_id']) + 1
|
|
1532
|
-
|
|
1533
|
-
delete result['for-calculations']
|
|
1534
|
-
result = { ...result, parentCount, currentParent, siblingCount, currentSibling }
|
|
1535
|
-
return result
|
|
1536
|
-
} else {
|
|
1537
|
-
delete result['for-calculations']
|
|
1538
|
-
return result
|
|
1539
|
-
}
|
|
1391
|
+
return await fetchSanity(query, false)
|
|
1540
1392
|
}
|
|
1541
1393
|
|
|
1542
1394
|
/**
|
|
@@ -1628,10 +1480,7 @@ export async function fetchLiveEvent(brand, forcedContentId = null) {
|
|
|
1628
1480
|
"thumbnail": thumbnail.asset->url,
|
|
1629
1481
|
${artistOrInstructorName()},
|
|
1630
1482
|
difficulty_string,
|
|
1631
|
-
"instructors":
|
|
1632
|
-
name,
|
|
1633
|
-
web_url_path,
|
|
1634
|
-
},
|
|
1483
|
+
"instructors": ${instructorField},
|
|
1635
1484
|
'videoId': coalesce(live_event_youtube_id, video.external_id),
|
|
1636
1485
|
} | order(live_event_start_time)[0...1]`
|
|
1637
1486
|
: `*[status == 'scheduled' && brand == '${brand}' && defined(live_event_start_time) && live_event_start_time <= '${getSanityDate(startDateTemp, false)}' && live_event_end_time >= '${getSanityDate(endDateTemp, false)}']{
|
|
@@ -1665,7 +1514,7 @@ export async function fetchLiveEvent(brand, forcedContentId = null) {
|
|
|
1665
1514
|
*
|
|
1666
1515
|
* @example
|
|
1667
1516
|
* fetchPackData(404048)
|
|
1668
|
-
* .then(
|
|
1517
|
+
* .then(pack => console.log(pack))
|
|
1669
1518
|
* .catch(error => console.error(error));
|
|
1670
1519
|
*/
|
|
1671
1520
|
export async function fetchPackData(id) {
|
|
@@ -2024,9 +1873,9 @@ export async function fetchSanity(
|
|
|
2024
1873
|
return null
|
|
2025
1874
|
}
|
|
2026
1875
|
|
|
2027
|
-
if (globalConfig.sanityConfig.debug) {
|
|
2028
|
-
|
|
2029
|
-
}
|
|
1876
|
+
// if (globalConfig.sanityConfig.debug) {
|
|
1877
|
+
// console.log('fetchSanity Query:', query)
|
|
1878
|
+
// }
|
|
2030
1879
|
const perspective = globalConfig.sanityConfig.perspective ?? 'published'
|
|
2031
1880
|
const api = globalConfig.sanityConfig.useCachedAPI ? 'apicdn' : 'api'
|
|
2032
1881
|
const url = `https://${globalConfig.sanityConfig.projectId}.${api}.sanity.io/v${globalConfig.sanityConfig.version}/data/query/${globalConfig.sanityConfig.dataset}?perspective=${perspective}`
|
|
@@ -2159,7 +2008,12 @@ export async function fetchShowsData(brand) {
|
|
|
2159
2008
|
* .catch(error => console.error(error));
|
|
2160
2009
|
*/
|
|
2161
2010
|
export async function fetchMetadata(brand, type) {
|
|
2162
|
-
|
|
2011
|
+
let processedData = processMetadata(brand, type, true)
|
|
2012
|
+
if(processedData?.onlyAvailableTabs === true) {
|
|
2013
|
+
const activeTabs = await fetchRecentActivitiesActiveTabs()
|
|
2014
|
+
processedData.tabs = activeTabs
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2163
2017
|
return processedData ? processedData : {}
|
|
2164
2018
|
}
|
|
2165
2019
|
|
|
@@ -2403,13 +2257,13 @@ export async function fetchTabData(
|
|
|
2403
2257
|
|
|
2404
2258
|
// limits the results to supplied progressIds for started & completed filters
|
|
2405
2259
|
const progressFilter = await getProgressFilter(progress, progressIds)
|
|
2406
|
-
if(sort
|
|
2260
|
+
if (sort === "recommended"){
|
|
2407
2261
|
progressIds = await recommendations(brand);
|
|
2408
2262
|
withoutPagination = true;
|
|
2409
2263
|
}
|
|
2410
2264
|
|
|
2411
|
-
|
|
2412
|
-
|
|
2265
|
+
const fieldsString = getFieldsForContentType('tab-data');
|
|
2266
|
+
const now = getSanityDate(new Date())
|
|
2413
2267
|
|
|
2414
2268
|
// Determine the group by clause
|
|
2415
2269
|
let query = ''
|
|
@@ -2419,8 +2273,9 @@ export async function fetchTabData(
|
|
|
2419
2273
|
filter = `brand == "${brand}" ${includedFieldsFilter} ${progressFilter}`
|
|
2420
2274
|
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
2421
2275
|
entityFieldsString =
|
|
2422
|
-
` ${fieldsString}
|
|
2276
|
+
` ${fieldsString}
|
|
2423
2277
|
'children': child[${childrenFilter}]->{'id': railcontent_id},
|
|
2278
|
+
'isLive': live_event_start_time <= "${now}" && live_event_end_time >= "${now}",
|
|
2424
2279
|
'lesson_count': coalesce(count(child[${childrenFilter}]->), 0),
|
|
2425
2280
|
'length_in_seconds': coalesce(
|
|
2426
2281
|
math::sum(
|
|
@@ -2430,7 +2285,6 @@ export async function fetchTabData(
|
|
|
2430
2285
|
),
|
|
2431
2286
|
length_in_seconds
|
|
2432
2287
|
),`
|
|
2433
|
-
|
|
2434
2288
|
const filterWithRestrictions = await new FilterBuilder(filter, {}).buildFilter()
|
|
2435
2289
|
query = buildEntityAndTotalQuery(filterWithRestrictions, entityFieldsString, {
|
|
2436
2290
|
sortOrder: sortOrder,
|
|
@@ -2532,7 +2386,7 @@ export async function fetchShows(brand, type, sort = 'sort') {
|
|
|
2532
2386
|
<br class="clear">
|
|
2533
2387
|
|
|
2534
2388
|
<footer>
|
|
2535
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on
|
|
2389
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri Jul 25 2025 21:19:12 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
2536
2390
|
</footer>
|
|
2537
2391
|
|
|
2538
2392
|
<script>prettyPrint();</script>
|