musora-content-services 2.27.3 → 2.27.5

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,24 @@
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.27.5](https://github.com/railroadmedia/musora-content-services/compare/v2.27.3...v2.27.5) (2025-07-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * MU2-848 New releases should only show published releases, not scheduled conte… ([34f081e](https://github.com/railroadmedia/musora-content-services/commit/34f081e56be1a7a562004d76fd9ca3ae1955e726))
11
+ * MU2-848 New releases should only show published releases, not scheduled conte… ([637bad5](https://github.com/railroadmedia/musora-content-services/commit/637bad53c5e5c57f24b785ea0e7d35aa56fe0eb5))
12
+ * T3PS-272 Update course part meta ([4249b35](https://github.com/railroadmedia/musora-content-services/commit/4249b352c4abb9798a3232aa5fd3d25dc89461fd))
13
+ * **T3PS-306:** add custom method to delete profile picture ([#369](https://github.com/railroadmedia/musora-content-services/issues/369)) ([61634db](https://github.com/railroadmedia/musora-content-services/commit/61634db6923f9ca4fdde9a5c20f18e8b61dd78ec))
14
+ * T3PS-501: Homepage progress rows - content types ([954df2f](https://github.com/railroadmedia/musora-content-services/commit/954df2f92099c58e2b9c545d7c8515aa53eda0a8))
15
+
16
+ ### [2.27.4](https://github.com/railroadmedia/musora-content-services/compare/v2.27.3...v2.27.4) (2025-07-23)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **T3PS-306:** add custom method to delete profile picture ([#369](https://github.com/railroadmedia/musora-content-services/issues/369)) ([61634db](https://github.com/railroadmedia/musora-content-services/commit/61634db6923f9ca4fdde9a5c20f18e8b61dd78ec))
22
+
5
23
  ### [2.27.3](https://github.com/railroadmedia/musora-content-services/compare/v2.27.0...v2.27.3) (2025-07-23)
6
24
 
7
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.27.3",
3
+ "version": "2.27.5",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
@@ -182,7 +182,7 @@ export const lessonTypesMapping = {
182
182
  export const getNextLessonLessonParentTypes = ['course', 'guided-course', 'pack', 'pack-bundle', 'song-tutorial'];
183
183
 
184
184
  export const progressTypesMapping = {
185
- 'lesson': [...singleLessonTypes,...practiceAlongsLessonTypes, ...liveArchivesLessonTypes, ...performancesLessonTypes, ...studentArchivesLessonTypes, ...documentariesLessonTypes, 'live', 'pack-bundle-lesson', 'course-part'],
185
+ 'lesson': [...singleLessonTypes,...practiceAlongsLessonTypes, ...liveArchivesLessonTypes, ...performancesLessonTypes, ...studentArchivesLessonTypes, ...documentariesLessonTypes, 'live', 'pack-bundle-lesson'],
186
186
  'course': ['course'],
187
187
  'show': showsLessonTypes,
188
188
  'song tutorial': [...tutorialsLessonTypes, 'song-tutorial-children'],
@@ -192,6 +192,7 @@ export const progressTypesMapping = {
192
192
  'pack': ['pack', 'semester-pack'],
193
193
  'method': ['learning-path'],
194
194
  'jam track': ['jam-track'],
195
+ 'course video': ['course-part'],
195
196
  };
196
197
 
197
198
  export const songs = {
package/src/index.d.ts CHANGED
@@ -279,6 +279,7 @@ import {
279
279
  } from './services/user/permissions.js';
280
280
 
281
281
  import {
282
+ deleteProfilePicture,
282
283
  otherStats
283
284
  } from './services/user/profile.js';
284
285
 
@@ -335,6 +336,7 @@ declare module 'musora-content-services' {
335
336
  deletePicture,
336
337
  deletePlaylist,
337
338
  deletePracticeSession,
339
+ deleteProfilePicture,
338
340
  deleteUserActivity,
339
341
  duplicatePlaylist,
340
342
  editComment,
package/src/index.js CHANGED
@@ -279,6 +279,7 @@ import {
279
279
  } from './services/user/permissions.js';
280
280
 
281
281
  import {
282
+ deleteProfilePicture,
282
283
  otherStats
283
284
  } from './services/user/profile.js';
284
285
 
@@ -334,6 +335,7 @@ export {
334
335
  deletePicture,
335
336
  deletePlaylist,
336
337
  deletePracticeSession,
338
+ deleteProfilePicture,
337
339
  deleteUserActivity,
338
340
  duplicatePlaylist,
339
341
  editComment,
File without changes
File without changes
File without changes
@@ -351,7 +351,7 @@ export async function fetchNewReleases(
351
351
  const end = start + limit
352
352
  const sortOrder = getSortOrder(sort, brand)
353
353
  const nextQuarter = getNextAndPreviousQuarterDates()['next']
354
- const filter = `_type in ${typesString} && brand == '${brand}' && show_in_new_feed == true && (!defined(quarter_published) || quarter_published != '${nextQuarter}')`
354
+ const filter = `_type in ${typesString} && brand == '${brand}' && status == 'published' && show_in_new_feed == true && (!defined(quarter_published) || quarter_published != '${nextQuarter}')`
355
355
  const fields = `
356
356
  "id": railcontent_id,
357
357
  title,
@@ -31,3 +31,16 @@ export async function otherStats(userId = globalConfig.sessionConfig.userId) {
31
31
  total_practice_time: longestStreaks.totalPracticeSeconds,
32
32
  }
33
33
  }
34
+
35
+ export async function deleteProfilePicture() {
36
+ const url = `${baseUrl}/v1/users/profile_picture`
37
+ const response = await fetchHandler(url, 'DELETE')
38
+
39
+ if (!response.ok) {
40
+ const problemDetails = await response.json()
41
+ console.log('Error deleting profile picture:', problemDetails.detail)
42
+ throw new Error(`Delete failed: ${problemDetails.detail}`)
43
+ }
44
+
45
+ return response.json()
46
+ }
@@ -18,7 +18,7 @@ import {fetchPlaylist, fetchUserPlaylists} from "./content-org/playlists"
18
18
  import {pinnedGuidedCourses} from "./content-org/guided-courses"
19
19
  import {convertToTimeZone, getMonday, getWeekNumber, isSameDate, isNextDay, getTimeRemainingUntilLocal, toDayjs} from './dateUtils.js'
20
20
  import { globalConfig } from './config'
21
- import {collectionLessonTypes, lessonTypesMapping, progressTypesMapping, showsLessonTypes, songs} from "../contentTypeConfig";
21
+ import {collectionLessonTypes, lessonTypesMapping, progressTypesMapping, recentTypes, showsLessonTypes, songs} from "../contentTypeConfig";
22
22
  import {
23
23
  getAllStartedOrCompleted,
24
24
  getProgressPercentageByIds,
@@ -355,9 +355,14 @@ export async function removeUserPractice(id) {
355
355
  async function (localContext) {
356
356
  if (localContext.data?.[DATA_KEY_PRACTICES]) {
357
357
  Object.keys(localContext.data[DATA_KEY_PRACTICES]).forEach((date) => {
358
- localContext.data[DATA_KEY_PRACTICES][date] = localContext.data[DATA_KEY_PRACTICES][
359
- date
360
- ].filter((practice) => practice.id !== id)
358
+ const filtered = localContext.data[DATA_KEY_PRACTICES][date].filter(
359
+ (practice) => practice.id !== id
360
+ )
361
+ if (filtered.length > 0) {
362
+ localContext.data[DATA_KEY_PRACTICES][date] = filtered
363
+ } else {
364
+ delete localContext.data[DATA_KEY_PRACTICES][date]
365
+ }
361
366
  })
362
367
  }
363
368
  },
@@ -963,11 +968,14 @@ export async function getProgressRows({ brand = null, limit = 8 } = {}) {
963
968
  }
964
969
  });
965
970
 
971
+ const allRecentTypeSet = new Set(
972
+ Object.values(recentTypes).flat()
973
+ )
966
974
  const progressMap = new Map();
967
975
  for (const [idStr, progress] of Object.entries(progressContents)) {
968
976
  const id = parseInt(idStr);
969
977
  const content = contentsMap[id];
970
- if (!content || excludedTypes.has(content.type)) continue;
978
+ if (!content || excludedTypes.has(content.type) || !allRecentTypeSet.has(content.type) ) continue;
971
979
  const parentId = childToParentMap[id];
972
980
  // Handle children with parents
973
981
  if (parentId) {