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.
@@ -23,6 +23,7 @@ export const useFetchVideosSearchByNiche = async (apiMethod: (...args: any[]) =>
23
23
  },
24
24
  lang,
25
25
  slug.value,
26
+ '-_score'
26
27
  )(),
27
28
  {
28
29
  watch: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.790",
4
+ "version": "0.0.792",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -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: string): string => {
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.map((action) => ({
19
- start: Number(action.duration) || 0,
20
- title: humanize(action.title),
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,