musora-content-services 2.28.1 → 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/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.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
+
5
12
  ### [2.28.1](https://github.com/railroadmedia/musora-content-services/compare/v2.28.0...v2.28.1) (2025-07-24)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.28.1",
3
+ "version": "2.28.2",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1411,7 +1411,8 @@ export async function fetchLessonsFeaturingThisContent(railcontentId, brand, cou
1411
1411
  */
1412
1412
  async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, count) {
1413
1413
  const typeCheck = `@->_type in [${arrayJoinWithQuotes(SONG_TYPES)}]`
1414
- const typeCheckString = onlyUseSongTypes ? `${typeCheck}` : `!(${typeCheck})`
1414
+ let typeCheckString = `@->brand == '${brand}' && `
1415
+ typeCheckString += onlyUseSongTypes ? `${typeCheck}` : `!(${typeCheck})`
1415
1416
  const contentFromLicenseFilter = `_type == 'license' && references(^._id)].content[${typeCheckString} && @->railcontent_id != ${railcontentId}`
1416
1417
  let filterSongTypesWithSameLicense = await new FilterBuilder(contentFromLicenseFilter, {
1417
1418
  isChildrenFilter: true,
@@ -1428,7 +1429,6 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
1428
1429
  "related_by_license" :
1429
1430
  *[${filterSongTypesWithSameLicense}]->{${queryFields}}|order(published_on desc, title asc)[0...${count}],
1430
1431
  }[0...1]`
1431
-
1432
1432
  const results = await fetchSanity(query, false)
1433
1433
  return results['related_by_license'] ?? []
1434
1434
  }
@@ -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
  }