itube-specs 0.0.715 → 0.0.718

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.
@@ -8,7 +8,7 @@ export const useFetchVideos = async (
8
8
  apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>
9
9
  ) => {
10
10
  const route = useRoute();
11
-
11
+
12
12
  const headers = useRequestHeaders()[ 'user-agent' ] ?? '';
13
13
  const mobile = isMobileDevice(headers);
14
14
  const perPage = mobile ? 12 : 48;
@@ -28,7 +28,7 @@ export const useFetchVideos = async (
28
28
  [ 'per-page' ]: perPage,
29
29
  },
30
30
  filters.value,
31
- getSelectedQuery(route, sortItemsDefault) || '-popularity,-primary_thumb_rank'
31
+ getSelectedQuery(route, sortItemsDefault) || '-country_order'
32
32
  )(),
33
33
  {
34
34
  watch: [
@@ -5,7 +5,7 @@ export const sortItemsDefault: Array<IChipsItem> = [
5
5
  title: 'sort.trending',
6
6
  value: 'trending',
7
7
  key: 'sort',
8
- query: '-popularity',
8
+ query: '-country_order',
9
9
  },
10
10
  {
11
11
  title: 'sort.new',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.715",
4
+ "version": "0.0.718",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -0,0 +1,45 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { cleanModelInfo } from '../clean-model-info';
3
+
4
+ describe('cleanModelInfo', () => {
5
+ it('полные данные', () => {
6
+ const raw = {
7
+ title: 'Model Name',
8
+ description: 'desc',
9
+ social: '@model',
10
+ videos_count: 50,
11
+ video_thumb_urls: { webp: { '320x180': 'https://img.com/s.webp' } },
12
+ parameters: 'height: 170',
13
+ long_description: 'long desc',
14
+ bio: 'bio text',
15
+ relatedNames: ['Model B'],
16
+ };
17
+ const result = cleanModelInfo(raw as any);
18
+ expect(result.title).toBe('Model Name');
19
+ expect(result.description).toBe('desc');
20
+ expect(result.social).toBe('@model');
21
+ expect(result.videosCount).toBe(50);
22
+ expect(result.img).toBe('https://img.com/s.webp');
23
+ expect(result.parameters).toBe('height: 170');
24
+ expect(result.fullDescription).toBe('long desc');
25
+ expect(result.relatedNames).toEqual(['Model B']);
26
+ });
27
+
28
+ it('без long_description → берёт bio', () => {
29
+ const raw = { long_description: '', bio: 'bio text', video_thumb_urls: { webp: {} } };
30
+ const result = cleanModelInfo(raw as any);
31
+ expect(result.fullDescription).toBe('bio text');
32
+ });
33
+
34
+ it('пустые данные → дефолты', () => {
35
+ const result = cleanModelInfo({} as any);
36
+ expect(result.title).toBe('');
37
+ expect(result.description).toBe('');
38
+ expect(result.social).toBe('');
39
+ expect(result.videosCount).toBe(0);
40
+ expect(result.img).toBe('');
41
+ expect(result.parameters).toBe('');
42
+ expect(result.fullDescription).toBe('');
43
+ expect(result.relatedNames).toEqual([]);
44
+ });
45
+ });