musora-content-services 2.134.8 → 2.135.1

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(rg:*)",
5
+ "Bash(npm run lint:*)"
6
+ ],
7
+ "deny": []
8
+ }
9
+ }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
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.135.1](https://github.com/railroadmedia/musora-content-services/compare/v2.135.0...v2.135.1) (2026-02-19)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * stop normalizing object ([#827](https://github.com/railroadmedia/musora-content-services/issues/827)) ([82d10d6](https://github.com/railroadmedia/musora-content-services/commit/82d10d6ab9fa45cdffe0cee607fe769ec8f1d53e))
11
+
12
+ ## [2.135.0](https://github.com/railroadmedia/musora-content-services/compare/v2.134.8...v2.135.0) (2026-02-18)
13
+
14
+
15
+ ### Features
16
+
17
+ * melon fresher progress and practices ([#826](https://github.com/railroadmedia/musora-content-services/issues/826)) ([dcbc98d](https://github.com/railroadmedia/musora-content-services/commit/dcbc98dd5270214ff7d719648943b4d335c4d62e))
18
+
5
19
  ### [2.134.8](https://github.com/railroadmedia/musora-content-services/compare/v2.134.7...v2.134.8) (2026-02-18)
6
20
 
7
21
  ### [2.134.7](https://github.com/railroadmedia/musora-content-services/compare/v2.134.6...v2.134.7) (2026-02-18)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.134.8",
3
+ "version": "2.135.1",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -537,7 +537,7 @@ async function saveContentProgress(contentId, collection, progress, currentSecon
537
537
  }
538
538
 
539
539
  if (Object.keys(bubbledProgresses).length > 0) {
540
- await db.contentProgress.recordProgressMany(normalizeContentIds(bubbledProgresses), normalizeCollection(collection), {skipPush: true, fromLearningPath})
540
+ await db.contentProgress.recordProgressMany(bubbledProgresses, normalizeCollection(collection), {skipPush: true, fromLearningPath})
541
541
  }
542
542
 
543
543
  if (isLP) {
@@ -605,7 +605,7 @@ async function setStartedOrCompletedStatusMany(contentIds, collection, isComplet
605
605
  }
606
606
 
607
607
  const contents = Object.fromEntries(contentIds.map((id) => [id, progress]))
608
- const response = await db.contentProgress.recordProgressMany(normalizeContentIds(contents), normalizeCollection(collection), {skipPush: true})
608
+ const response = await db.contentProgress.recordProgressMany(contents, normalizeCollection(collection), {skipPush: true})
609
609
 
610
610
  // we assume this is used only for contents within the same hierarchy
611
611
  const hierarchy = await getHierarchy(collection.id, collection)
@@ -780,7 +780,7 @@ async function bubbleAndTrickleProgressesSafely(progresses, collection) {
780
780
  Object.entries(progresses).filter(([_, pct]) => pct > 0)
781
781
  )
782
782
  if (Object.keys(progresses).length > 0) {
783
- await db.contentProgress.recordProgressMany(normalizeContentIds(progresses), normalizeCollection(collection), {skipPush: true})
783
+ await db.contentProgress.recordProgressMany(progresses, normalizeCollection(collection), {skipPush: true})
784
784
  }
785
785
  if (Object.keys(eraseProgresses).length > 0) {
786
786
  const eraseIds = Object.keys(eraseProgresses).map(Number)
@@ -16,6 +16,7 @@ import { fetchPlaylist } from '../content-org/playlists.js'
16
16
  import { TabResponseType } from '../../contentMetaData.js'
17
17
  import { GET, PUT } from '../../infrastructure/http/HttpClient.ts'
18
18
  import { postProcessBadge } from "../../contentTypeConfig.js";
19
+ import { db } from '../sync/index.js'
19
20
 
20
21
  export const USER_PIN_PROGRESS_KEY = 'user_pin_progress_row'
21
22
  const CACHE_EXPIRY_MS = 5 * 60 * 1000
@@ -157,7 +158,16 @@ function isCacheValid(cachedData) {
157
158
  * .then(data => console.log(data))
158
159
  * .catch(error => console.error(error));
159
160
  */
160
- export async function getProgressRows({ brand = 'drumeo', limit = 8 } = {}) {
161
+ export async function getProgressRows({ brand = 'drumeo', limit = 8 } = {}, options = {}) {
162
+ // since this MCS method abstracts db, provide pull abstractions instead of making MPF/MA do it on their own
163
+ if (options.pull) {
164
+ await db.contentProgress.pull()
165
+ }
166
+ // otherwise check for fresh data from server by default
167
+ else {
168
+ db.contentProgress.pull()
169
+ }
170
+
161
171
  const [userPinnedItem, recentPlaylists] = await Promise.all([
162
172
  getUserPinnedItem(brand),
163
173
  getRecentPlaylists(brand, limit),
@@ -242,6 +242,10 @@ export default class SyncRepository<TModel extends BaseModel> {
242
242
  return result
243
243
  }
244
244
 
245
+ pull() {
246
+ return this.store.pull('repo-pull')
247
+ }
248
+
245
249
  requestPushUnsynced(cause?: string) {
246
250
  this.store.pushUnsyncedWithRetry(undefined, { type: 'repo-push-request', cause })
247
251
  }
@@ -432,12 +432,21 @@ export async function restorePracticeSession(date) {
432
432
  * .then(response => console.log(response))
433
433
  * .catch(error => console.error(error));
434
434
  */
435
- export async function getPracticeSessions(params = {}) {
435
+ export async function getPracticeSessions(params = {}, options = {}) {
436
436
  const { day, userId = globalConfig.sessionConfig.userId } = params
437
437
 
438
438
  let data
439
439
 
440
440
  if (userId === globalConfig.sessionConfig.userId) {
441
+ // since this MCS method abstracts db, provide pull abstractions instead of making MPF/MA do it on their own
442
+ if (options.pull) {
443
+ await db.practices.pull()
444
+ }
445
+ // otherwise check for fresh data from server by default
446
+ else {
447
+ db.practices.pull()
448
+ }
449
+
441
450
  const query = await db.practices.queryAll(Q.where('date', day), Q.sortBy('created_at', 'asc'))
442
451
  data = query.data
443
452
  } else {