musora-content-services 1.0.215 → 1.0.217

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,10 @@
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
+ ### [1.0.217](https://github.com/railroadmedia/musora-content-services/compare/v1.0.216...v1.0.217) (2024-12-05)
6
+
7
+ ### [1.0.216](https://github.com/railroadmedia/musora-content-services/compare/v1.0.215...v1.0.216) (2024-12-04)
8
+
5
9
  ### [1.0.215](https://github.com/railroadmedia/musora-content-services/compare/v1.0.214...v1.0.215) (2024-12-04)
6
10
 
7
11
  ### [1.0.214](https://github.com/railroadmedia/musora-content-services/compare/v1.0.213...v1.0.214) (2024-12-04)
File without changes
package/docs/index.html CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/link_mcs.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.0.215",
3
+ "version": "1.0.217",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
File without changes
package/src/index.d.ts CHANGED
File without changes
package/src/index.js CHANGED
@@ -123,6 +123,7 @@ import {
123
123
  fetchSanity,
124
124
  fetchScheduledReleases,
125
125
  fetchShowsData,
126
+ fetchPlayAlongsCount,
126
127
  fetchSongArtistCount,
127
128
  fetchSongById,
128
129
  fetchSongCount,
@@ -210,6 +211,7 @@ export {
210
211
  fetchScheduledReleases,
211
212
  fetchShowsData,
212
213
  fetchSongArtistCount,
214
+ fetchPlayAlongsCount,
213
215
  fetchSongById,
214
216
  fetchSongCount,
215
217
  fetchSongFilterOptions,
File without changes
File without changes
@@ -254,20 +254,25 @@ async function postDataHandler(url, data) {
254
254
  }
255
255
 
256
256
  export async function fetchHandler(url, method = "get", dataVersion = null, body = null) {
257
- const params = new URLSearchParams(window.location.search);
258
257
  let headers = {
259
258
  'Content-Type': 'application/json',
260
259
  'X-CSRF-TOKEN': globalConfig.railcontentConfig.token,
261
260
  };
261
+
262
+ if (!globalConfig.isMA) {
263
+ const params = new URLSearchParams(window.location.search);
264
+ if (params.get('testNow')) {
265
+ headers['testNow'] = params.get('testNow');
266
+ }
267
+ if (params.get('timezone')) {
268
+ headers['M-Client-Timezone'] = params.get('timezone');
269
+ }
270
+ }
271
+
262
272
  if (globalConfig.railcontentConfig.authToken) {
263
273
  headers['Authorization'] = `Bearer ${globalConfig.railcontentConfig.authToken}`;
264
274
  }
265
- if (params.get('testNow')) {
266
- headers['testNow'] = params.get('testNow');
267
- }
268
- if (params.get('timezone')) {
269
- headers['M-Client-Timezone'] = params.get('timezone');
270
- }
275
+
271
276
  if (dataVersion) headers['Data-Version'] = dataVersion;
272
277
  const options = {
273
278
  method,
@@ -95,6 +95,11 @@ export async function fetchSongArtistCount(brand) {
95
95
  return fetchSanity(query, true, {processNeedAccess: false});
96
96
  }
97
97
 
98
+ export async function fetchPlayAlongsCount(brand) {
99
+ const query = `count(*[brand == '${brand}' && _type == "play-along"]) `
100
+ return fetchSanity(query, true, {processNeedAccess: false});
101
+ }
102
+
98
103
  /**
99
104
  * Fetch related songs for a specific brand and song ID.
100
105
  *
@@ -972,6 +977,7 @@ export async function fetchMethodChildren(railcontentId) {
972
977
  child_count,
973
978
  "id": railcontent_id,
974
979
  "description": ${descriptionField},
980
+ "thumbnail_url": thumbnail.asset->url,
975
981
  title,
976
982
  xp,
977
983
  total_xp,
File without changes
File without changes
File without changes
File without changes