musora-content-services 2.3.22 → 2.3.23
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,8 @@
|
|
|
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.3.23](https://github.com/railroadmedia/musora-content-services/compare/v2.3.22...v2.3.23) (2025-05-06)
|
|
6
|
+
|
|
5
7
|
### [2.3.22](https://github.com/railroadmedia/musora-content-services/compare/v2.3.21...v2.3.22) (2025-05-05)
|
|
6
8
|
|
|
7
9
|
### [2.3.21](https://github.com/railroadmedia/musora-content-services/compare/v2.3.20...v2.3.21) (2025-05-02)
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ import {
|
|
|
29
29
|
getTabResults
|
|
30
30
|
} from './services/content.js';
|
|
31
31
|
|
|
32
|
+
import {
|
|
33
|
+
addContextToContent
|
|
34
|
+
} from './services/contentAggregator.js';
|
|
35
|
+
|
|
32
36
|
import {
|
|
33
37
|
isContentLiked,
|
|
34
38
|
isContentLikedByIds,
|
|
@@ -53,10 +57,6 @@ import {
|
|
|
53
57
|
recordWatchSession
|
|
54
58
|
} from './services/contentProgress.js';
|
|
55
59
|
|
|
56
|
-
import {
|
|
57
|
-
addContextToContent
|
|
58
|
-
} from './contentAggregator.js';
|
|
59
|
-
|
|
60
60
|
import {
|
|
61
61
|
verifyLocalDataContext
|
|
62
62
|
} from './services/dataContext.js';
|
|
@@ -237,8 +237,8 @@ import {
|
|
|
237
237
|
|
|
238
238
|
declare module 'musora-content-services' {
|
|
239
239
|
export {
|
|
240
|
+
addContextToContent,
|
|
240
241
|
addItemToPlaylist,
|
|
241
|
-
addContextToContent,
|
|
242
242
|
applyCloudflareWrapper,
|
|
243
243
|
applySanityTransformations,
|
|
244
244
|
assignModeratorToComment,
|
package/src/index.js
CHANGED
|
@@ -29,6 +29,10 @@ import {
|
|
|
29
29
|
getTabResults
|
|
30
30
|
} from './services/content.js';
|
|
31
31
|
|
|
32
|
+
import {
|
|
33
|
+
addContextToContent
|
|
34
|
+
} from './services/contentAggregator.js';
|
|
35
|
+
|
|
32
36
|
import {
|
|
33
37
|
isContentLiked,
|
|
34
38
|
isContentLikedByIds,
|
|
@@ -84,9 +88,6 @@ import {
|
|
|
84
88
|
isBucketUrl,
|
|
85
89
|
verifyImageSRC
|
|
86
90
|
} from './services/imageSRCVerify.js';
|
|
87
|
-
import {
|
|
88
|
-
addContextToContent
|
|
89
|
-
} from './contentAggregator.js';
|
|
90
91
|
|
|
91
92
|
import {
|
|
92
93
|
assignModeratorToComment,
|
|
@@ -235,6 +236,7 @@ import {
|
|
|
235
236
|
} from './services/userActivity.js';
|
|
236
237
|
|
|
237
238
|
export {
|
|
239
|
+
addContextToContent,
|
|
238
240
|
addItemToPlaylist,
|
|
239
241
|
applyCloudflareWrapper,
|
|
240
242
|
applySanityTransformations,
|
|
@@ -412,5 +414,4 @@ export {
|
|
|
412
414
|
updateUserPractice,
|
|
413
415
|
verifyImageSRC,
|
|
414
416
|
verifyLocalDataContext,
|
|
415
|
-
addContextToContent
|
|
416
417
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { getProgressStateByIds, getProgressPercentageByIds, getResumeTimeSecondsByIds } from "./services/contentProgress"
|
|
1
|
+
import { getProgressStateByIds, getProgressPercentageByIds, getResumeTimeSecondsByIds } from "./services/contentProgress"
|
|
2
2
|
import { isContentLikedByIds } from "./services/contentLikes"
|
|
3
3
|
import { fetchLikeCount } from "./services/railcontent"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export async function addContextToContent(dataPromise, ...dataArgs)
|
|
8
|
+
{
|
|
6
9
|
const lastArg = dataArgs[dataArgs.length - 1]
|
|
7
10
|
const options = typeof lastArg === 'object' && !Array.isArray(lastArg) ? lastArg : {}
|
|
8
11
|
|
|
@@ -47,7 +50,7 @@ export const addContextToContent = async (dataPromise, ...dataArgs) => {
|
|
|
47
50
|
...(addLikeCount && ids.length === 1 ? { likeCount: await fetchLikeCount(item.id) } : {}),
|
|
48
51
|
...(addResumeTimeSeconds ? { resumeTime: resumeTimeData?.[item.id] } : {}),
|
|
49
52
|
})
|
|
50
|
-
|
|
53
|
+
|
|
51
54
|
const newData = Array.isArray(data)
|
|
52
55
|
? await Promise.all(data.map(addContext))
|
|
53
56
|
: await addContext(data)
|