itube-specs 0.0.790 → 0.0.792
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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IRawVideoData, IVideoData, ISceneGroup, ITimelineGroup } from '../../../types';
|
|
2
2
|
|
|
3
3
|
// «locations» → «Locations», «living_room» → «Living room».
|
|
4
|
-
const humanize = (value
|
|
5
|
-
const text = value.replace(/_/g, ' ').trim();
|
|
4
|
+
const humanize = (value?: string | null): string => {
|
|
5
|
+
const text = (value ?? '').replace(/_/g, ' ').trim();
|
|
6
6
|
return text ? text.charAt(0).toUpperCase() + text.slice(1) : text;
|
|
7
7
|
};
|
|
8
8
|
|
|
@@ -13,13 +13,16 @@ const cleanTimelineGroups = (raw: ITimelineGroup[] | null): ISceneGroup[] | null
|
|
|
13
13
|
const groups = raw
|
|
14
14
|
.filter((group) => Array.isArray(group?.actions) && group.actions.length > 0)
|
|
15
15
|
.map((group) => ({
|
|
16
|
-
id: group.name,
|
|
16
|
+
id: group.name || '',
|
|
17
17
|
title: humanize(group.name),
|
|
18
|
-
scenes: group.actions
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
scenes: group.actions
|
|
19
|
+
.filter((action) => action?.title)
|
|
20
|
+
.map((action) => ({
|
|
21
|
+
start: Number(action.duration) || 0,
|
|
22
|
+
title: humanize(action.title),
|
|
23
|
+
})),
|
|
24
|
+
}))
|
|
25
|
+
.filter((group) => group.scenes.length > 0);
|
|
23
26
|
|
|
24
27
|
return groups.length ? groups : null;
|
|
25
28
|
};
|
|
@@ -19,6 +19,7 @@ export class VideosApiService {
|
|
|
19
19
|
pagination: RequestPagination,
|
|
20
20
|
lang: Language,
|
|
21
21
|
phrase: string,
|
|
22
|
+
order: string,
|
|
22
23
|
niche = NicheHelper.getSiteDefaultNiche(),
|
|
23
24
|
): Promise<PaginatedResponse<IVideoCard>> {
|
|
24
25
|
return await ApiHelper.fetch(
|
|
@@ -33,6 +34,7 @@ export class VideosApiService {
|
|
|
33
34
|
},
|
|
34
35
|
params: {
|
|
35
36
|
...pagination,
|
|
37
|
+
order,
|
|
36
38
|
},
|
|
37
39
|
body: {
|
|
38
40
|
query: phrase,
|