itube-specs 0.0.765 → 0.0.767
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/composables/__tests__/use-format-time-ago.test.ts +39 -0
- package/composables/__tests__/use-model-filter-chips.test.ts +19 -5
- package/composables/fetch/use-fetch-categories-by-letter.ts +4 -4
- package/composables/fetch/use-fetch-categories-by-name.ts +4 -4
- package/composables/fetch/use-fetch-categories-by-phrase.ts +4 -4
- package/composables/fetch/use-fetch-categories-group-by-letter.ts +3 -3
- package/composables/fetch/use-fetch-categories-related.ts +4 -4
- package/composables/fetch/use-fetch-channels-by-model.ts +4 -4
- package/composables/fetch/use-fetch-channels-by-name.ts +4 -4
- package/composables/fetch/use-fetch-channels-by-network-name.ts +4 -4
- package/composables/fetch/use-fetch-channels.ts +4 -4
- package/composables/fetch/use-fetch-dictionaries-countries.ts +4 -4
- package/composables/fetch/use-fetch-dictionaries-genders.ts +4 -4
- package/composables/fetch/use-fetch-footer-categories.ts +4 -4
- package/composables/fetch/use-fetch-groups-categories-lazy.ts +2 -2
- package/composables/fetch/use-fetch-groups-categories.ts +4 -4
- package/composables/fetch/use-fetch-model-by-name.ts +4 -4
- package/composables/fetch/use-fetch-models-by-category.ts +4 -4
- package/composables/fetch/use-fetch-models-by-channel.ts +4 -4
- package/composables/fetch/use-fetch-models-by-letter.ts +4 -4
- package/composables/fetch/use-fetch-models-by-phrases.ts +4 -4
- package/composables/fetch/use-fetch-models-by-tag.ts +4 -4
- package/composables/fetch/use-fetch-models-related.ts +4 -4
- package/composables/fetch/use-fetch-models.ts +4 -4
- package/composables/fetch/use-fetch-multi-suggest.ts +4 -4
- package/composables/fetch/use-fetch-playlists-by-id.ts +3 -3
- package/composables/fetch/use-fetch-playlists-by-niche.ts +4 -4
- package/composables/fetch/use-fetch-playlists-get-videos-by-id.ts +3 -3
- package/composables/fetch/use-fetch-popular-tags-by-channel-name.ts +4 -4
- package/composables/fetch/use-fetch-popular-tags-by-model-name.ts +4 -4
- package/composables/fetch/use-fetch-related-searches.ts +4 -4
- package/composables/fetch/use-fetch-related-videos.ts +4 -4
- package/composables/fetch/use-fetch-top-chips-models.ts +4 -4
- package/composables/fetch/use-fetch-top-models.ts +3 -3
- package/composables/fetch/use-fetch-top-random-categories.ts +4 -4
- package/composables/fetch/use-fetch-top-random-full.ts +5 -5
- package/composables/fetch/use-fetch-video-referer-phrases.ts +4 -4
- package/composables/fetch/use-fetch-video.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-categories.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-channel.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-model-and-channel.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-model-and-tag.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-model.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-tag.ts +4 -4
- package/composables/fetch/use-fetch-videos-search-by-niche.ts +4 -4
- package/composables/fetch/use-fetch-videos.ts +4 -4
- package/composables/use-auth-popup.ts +4 -4
- package/composables/use-format-time-ago.ts +13 -21
- package/composables/use-generate-link.ts +3 -3
- package/composables/use-model-filter-chips.ts +3 -2
- package/composables/use-playlist-add.ts +2 -2
- package/composables/use-playlist-edit.ts +5 -5
- package/lib/contact-forms-scheme.ts +6 -6
- package/lib/report-forms-scheme.ts +6 -6
- package/nuxt.config.ts +1 -1
- package/package.json +1 -1
- package/runtime/constants/async-data.ts +61 -0
- package/runtime/constants/auth-step.ts +7 -0
- package/runtime/constants/contacts-subjects.ts +9 -0
- package/runtime/constants/languages.ts +22 -0
- package/runtime/constants/niche.ts +8 -0
- package/runtime/constants/playlist-step.ts +7 -0
- package/runtime/constants/playlist-type.ts +6 -0
- package/runtime/constants/report-forms-subjects.ts +9 -0
- package/runtime/constants/thumb-size.ts +7 -0
- package/runtime/index.ts +9 -11
- package/runtime/utils/__tests__/get-month.test.ts +10 -8
- package/runtime/utils/cleaners/clean-category-card.ts +1 -1
- package/runtime/utils/cleaners/clean-category-info.ts +1 -1
- package/runtime/utils/cleaners/clean-channel-card.ts +1 -1
- package/runtime/utils/cleaners/clean-channel-info.ts +1 -1
- package/runtime/utils/cleaners/clean-model-card.ts +1 -1
- package/runtime/utils/cleaners/clean-model-info.ts +1 -1
- package/runtime/utils/cleaners/clean-playlist-card.ts +1 -1
- package/runtime/utils/cleaners/clean-user-playlists-card.ts +1 -1
- package/runtime/utils/cleaners/clean-video-card.ts +1 -1
- package/runtime/utils/converters/convert-model-card-to-chips.ts +1 -1
- package/runtime/utils/get-month.ts +5 -20
- package/types/contacts-form.d.ts +2 -2
- package/types/contacts-scheme.d.ts +2 -2
- package/types/playlist-card.d.ts +2 -2
- package/types/playlist-data.d.ts +2 -2
- package/types/playlist-short.d.ts +2 -2
- package/types/raw/raw-playlist-card.d.ts +2 -2
- package/types/raw/raw-playlist-data.d.ts +2 -2
- package/types/raw/raw-playlist-user.d.ts +2 -2
- package/types/raw/raw-thumbs-urls.d.ts +1 -1
- package/types/report-form.d.ts +2 -2
- package/types/report-scheme.d.ts +2 -2
- package/types/thumbs-urls.d.ts +1 -1
- package/runtime/enums/async-data.ts +0 -59
- package/runtime/enums/auth-step.ts +0 -5
- package/runtime/enums/contacts-subjects.ts +0 -7
- package/runtime/enums/languages.ts +0 -20
- package/runtime/enums/niche.ts +0 -6
- package/runtime/enums/playlist-step.ts +0 -5
- package/runtime/enums/playlist-type.ts +0 -4
- package/runtime/enums/report-forms-subjects.ts +0 -7
- package/runtime/enums/thumb-size.ts +0 -5
- package/runtime/utils/__tests__/format-number.test.ts +0 -24
- package/runtime/utils/__tests__/format-time-ago.test.ts +0 -49
- package/runtime/utils/format-number.ts +0 -12
- package/runtime/utils/format-time-ago.ts +0 -26
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { useFormatTimeAgo } from '../use-format-time-ago';
|
|
3
|
+
|
|
4
|
+
describe('useFormatTimeAgo', () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
vi.useFakeTimers();
|
|
7
|
+
vi.setSystemTime(new Date('2025-06-15T12:00:00Z'));
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.useRealTimers();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const now = () => Math.floor(Date.now() / 1000);
|
|
15
|
+
|
|
16
|
+
it('сегодня', () => {
|
|
17
|
+
expect(useFormatTimeAgo(now(), 'en')).toBe('today');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('вчера', () => {
|
|
21
|
+
expect(useFormatTimeAgo(now() - 86400, 'en')).toBe('yesterday');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('5 дней назад', () => {
|
|
25
|
+
expect(useFormatTimeAgo(now() - 5 * 86400, 'en')).toBe('5 days ago');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('3 месяца назад', () => {
|
|
29
|
+
expect(useFormatTimeAgo(now() - 90 * 86400, 'en')).toBe('3 months ago');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('2 года назад', () => {
|
|
33
|
+
expect(useFormatTimeAgo(now() - 730 * 86400, 'en')).toBe('2 years ago');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('локализация (ru)', () => {
|
|
37
|
+
expect(useFormatTimeAgo(now() - 5 * 86400, 'ru')).toBe('5 дней назад');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -8,14 +8,14 @@ describe('useFilterChipsItems', () => {
|
|
|
8
8
|
it('пустой массив без filter_ в query', () => {
|
|
9
9
|
const filters = ref([]);
|
|
10
10
|
const route = { query: {} };
|
|
11
|
-
const { chipsItems } = useFilterChipsItems(filters, route, t);
|
|
11
|
+
const { chipsItems } = useFilterChipsItems(filters, route, t, ref('en'));
|
|
12
12
|
expect(chipsItems.value).toEqual([]);
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
it('игнорирует не-filter параметры', () => {
|
|
16
16
|
const filters = ref([]);
|
|
17
17
|
const route = { query: { page: '1', sort: 'popular' } };
|
|
18
|
-
const { chipsItems } = useFilterChipsItems(filters, route, t);
|
|
18
|
+
const { chipsItems } = useFilterChipsItems(filters, route, t, ref('en'));
|
|
19
19
|
expect(chipsItems.value).toEqual([]);
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ describe('useFilterChipsItems', () => {
|
|
|
29
29
|
],
|
|
30
30
|
}]);
|
|
31
31
|
const route = { query: { filter_hair_color: 'blonde' } };
|
|
32
|
-
const { chipsItems } = useFilterChipsItems(filters, route, t);
|
|
32
|
+
const { chipsItems } = useFilterChipsItems(filters, route, t, ref('en'));
|
|
33
33
|
expect(chipsItems.value).toHaveLength(1);
|
|
34
34
|
expect(chipsItems.value[0].title).toBe('Hair color: Blonde');
|
|
35
35
|
expect(chipsItems.value[0].value).toEqual(['filter_hair_color']);
|
|
@@ -45,7 +45,7 @@ describe('useFilterChipsItems', () => {
|
|
|
45
45
|
],
|
|
46
46
|
}]);
|
|
47
47
|
const route = { query: { filter_age_from: '18', filter_age_to: '30' } };
|
|
48
|
-
const { chipsItems } = useFilterChipsItems(filters, route, t);
|
|
48
|
+
const { chipsItems } = useFilterChipsItems(filters, route, t, ref('en'));
|
|
49
49
|
expect(chipsItems.value).toHaveLength(1);
|
|
50
50
|
expect(chipsItems.value[0].title).toBe('Age: 18 - 30');
|
|
51
51
|
expect(chipsItems.value[0].value).toEqual(['filter_age_from', 'filter_age_to']);
|
|
@@ -61,7 +61,21 @@ describe('useFilterChipsItems', () => {
|
|
|
61
61
|
],
|
|
62
62
|
}]);
|
|
63
63
|
const route = { query: { filter_weight: '65' } };
|
|
64
|
-
const { chipsItems } = useFilterChipsItems(filters, route, t);
|
|
64
|
+
const { chipsItems } = useFilterChipsItems(filters, route, t, ref('en'));
|
|
65
65
|
expect(chipsItems.value[0].title).toBe('Weight: 65');
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
it('месяц → локализованное название', () => {
|
|
69
|
+
const filters = ref([{
|
|
70
|
+
name: 'birth_month',
|
|
71
|
+
title: 'Birth month',
|
|
72
|
+
options: [
|
|
73
|
+
{ name: '1', title: '1' },
|
|
74
|
+
{ name: '12', title: '12' },
|
|
75
|
+
],
|
|
76
|
+
}]);
|
|
77
|
+
const route = { query: { filter_birth_month: '6' } };
|
|
78
|
+
const { chipsItems } = useFilterChipsItems(filters, route, t, ref('en'));
|
|
79
|
+
expect(chipsItems.value[0].title).toBe('Birth month: June');
|
|
80
|
+
});
|
|
67
81
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { ICategoryCard } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchCategoriesByLetter = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<Array<ICategoryCard>>
|
|
7
7
|
) => {
|
|
8
|
-
const key =
|
|
9
|
-
const lang = useLang() as
|
|
8
|
+
const key = AsyncData.CategoriesByLetter;
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const slug = useSlug();
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { ICardInfo } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchCategoriesByName = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<ICardInfo>
|
|
7
7
|
) => {
|
|
8
|
-
const key =
|
|
9
|
-
const lang = useLang() as
|
|
8
|
+
const key = AsyncData.CategoriesByName;
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const slug = useSlug();
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IChipsItem } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchCategoriesByPhrase = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<Array<IChipsItem>>
|
|
7
7
|
) => {
|
|
8
|
-
const key =
|
|
9
|
-
const lang = useLang() as
|
|
8
|
+
const key = AsyncData.CategoriesByPhrase;
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const slug = useSlug();
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AsyncData, Language } from '../../runtime';
|
|
2
2
|
import type { ICategoryCard, IChipsItem } from '../../types';
|
|
3
3
|
|
|
4
4
|
export const useFetchCategoriesGroupByLetter = async (
|
|
5
|
-
key:
|
|
5
|
+
key: AsyncData,
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<Record<string, Array<ICategoryCard>>> | Promise<IChipsItem[]>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
10
10
|
|
|
11
11
|
const { data, error, refresh, status } = await useAsyncData<Record<string, Array<ICategoryCard>> | IChipsItem[]>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IRelatedPhrases } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchCategoriesRelated = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IRelatedPhrases>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug();
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.CategoriesRelated;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const { data, status, error } = await useAsyncData<IRelatedPhrases>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IChannelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchChannelsByModel = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IChannelCard>>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug();
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.ChannelsByModel;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { ICardInfo } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchChannelsByName = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<ICardInfo>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug('channel');
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.ChannelByName;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const { data, status, error } = await useAsyncData<ICardInfo>(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useRoute } from 'vue-router';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { Language } from '../../runtime';
|
|
3
|
+
import { AsyncData } from '../../runtime';
|
|
4
4
|
import type { IChannelCard, PaginatedResponse } from '../../types';
|
|
5
5
|
|
|
6
6
|
export const useFetchChannelsByNetworkName = async (
|
|
7
7
|
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IChannelCard>>
|
|
8
8
|
) => {
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
12
|
const perPage = mobile ? 12 : 48;
|
|
13
13
|
const slug = useSlug('channel');
|
|
14
|
-
const key =
|
|
14
|
+
const key = AsyncData.ChannelsByNetworkName;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRoute } from 'vue-router';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { Language } from '../../runtime';
|
|
3
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
4
4
|
import { sortChannels } from '../../lib';
|
|
5
5
|
import type { IChannelCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
@@ -10,8 +10,8 @@ export const useFetchChannels = async (
|
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
12
|
const perPage = mobile ? 12 : 48;
|
|
13
|
-
const lang = useLang() as
|
|
14
|
-
const key =
|
|
13
|
+
const lang = useLang() as Language;
|
|
14
|
+
const key = AsyncData.Channels;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ICountries } from '../../types';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { Language } from '../../runtime';
|
|
3
|
+
import { AsyncData } from '../../runtime';
|
|
4
4
|
|
|
5
5
|
export const useFetchDictionariesCountries = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<ICountries>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
9
|
-
const key =
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.Countries;
|
|
10
10
|
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
12
|
const { data, status, error } = await useAsyncData<ICountries>(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { IGenders } from '../../types';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { Language } from '../../runtime';
|
|
3
|
+
import { AsyncData } from '../../runtime';
|
|
4
4
|
|
|
5
5
|
export const useFetchDictionariesGenders = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IGenders>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
9
|
-
const key =
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.Genders;
|
|
10
10
|
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
12
|
const { data, status, error } = await useAsyncData<IGenders>(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IChipsItem } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchFooterCategories = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IChipsItem[]>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
9
|
-
const key =
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.CategoriesTopRandomFooter;
|
|
10
10
|
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
12
|
const { data, status, error } = await useAsyncData<IChipsItem[]>(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
2
|
import type { IGroupCategories } from '../../types';
|
|
3
3
|
|
|
4
4
|
export const useFetchGroupsCategoriesLazy = (
|
|
@@ -6,7 +6,7 @@ export const useFetchGroupsCategoriesLazy = (
|
|
|
6
6
|
) => {
|
|
7
7
|
const data = useState<IGroupCategories[] | null>('lazy-groups-categories', () => null);
|
|
8
8
|
const isLoading = useState<boolean>('lazy-groups-categories-loading', () => false);
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
|
|
11
11
|
async function load() {
|
|
12
12
|
if (data.value?.length || isLoading.value) return;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IGroupCategories } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchGroupsCategories = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IGroupCategories[]>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
9
|
-
const key =
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.GroupsCategoriesFilter;
|
|
10
10
|
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
12
|
const { data, pending: status, error } = await useAsyncData<IGroupCategories[]>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { ICardInfo } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelByName = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<ICardInfo>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug();
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.ModelsByName;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const { data, status, error } = await useAsyncData<ICardInfo>(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelsByCategory = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>,
|
|
7
7
|
limit: number,
|
|
8
8
|
) => {
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const slug = useSlug();
|
|
11
|
-
const key =
|
|
11
|
+
const key = AsyncData.ModelsByCategory;
|
|
12
12
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
13
13
|
|
|
14
14
|
const { data, status } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelsByChannel = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>,
|
|
7
7
|
limit: number,
|
|
8
8
|
) => {
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const slug = useSlug('channel');
|
|
11
|
-
const key =
|
|
11
|
+
const key = AsyncData.ModelsByChannel;
|
|
12
12
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
13
13
|
|
|
14
14
|
const { data, status } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import { sortModels } from '../../lib';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
@@ -11,8 +11,8 @@ export const useFetchModelsByLetter = async (
|
|
|
11
11
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
12
|
const perPage = mobile ? 12 : 48;
|
|
13
13
|
const slug = useSlug();
|
|
14
|
-
const lang = useLang() as
|
|
15
|
-
const key =
|
|
14
|
+
const lang = useLang() as Language;
|
|
15
|
+
const key = AsyncData.ModelsByFirstLetter;
|
|
16
16
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
17
17
|
|
|
18
18
|
const filters = computed(() => Object.entries(route.query)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { convertString,
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { convertString, AsyncData } from '../../runtime';
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
@@ -9,9 +9,9 @@ export const useFetchModelsByPhrases = async (
|
|
|
9
9
|
const route = useRoute();
|
|
10
10
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
11
|
const perPage = mobile ? 12 : 48;
|
|
12
|
-
const lang = useLang() as
|
|
12
|
+
const lang = useLang() as Language;
|
|
13
13
|
const slug = useSlug();
|
|
14
|
-
const key =
|
|
14
|
+
const key = AsyncData.ModelsByPhrases;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelsByTag = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>,
|
|
7
7
|
limit: number,
|
|
8
8
|
) => {
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const slug = useSlug('tag');
|
|
11
|
-
const key =
|
|
11
|
+
const key = AsyncData.ModelsByTag;
|
|
12
12
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
13
13
|
|
|
14
14
|
const { data, status } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchRelatedModels = async (
|
|
@@ -7,9 +7,9 @@ export const useFetchRelatedModels = async (
|
|
|
7
7
|
limit: number,
|
|
8
8
|
cacheId: string
|
|
9
9
|
) => {
|
|
10
|
-
const lang = useLang() as
|
|
10
|
+
const lang = useLang() as Language;
|
|
11
11
|
const slug = useSlug();
|
|
12
|
-
const key =
|
|
12
|
+
const key = AsyncData.TopModelsMore;
|
|
13
13
|
const stateKey = computed(() => `data-${key}-${slug.value}-${cacheId}-${lang}`);
|
|
14
14
|
|
|
15
15
|
const { data, status, refresh } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import { sortModels } from '../../lib';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
@@ -10,8 +10,8 @@ export const useFetchModels = async (
|
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
12
|
const perPage = mobile ? 12 : 48;
|
|
13
|
-
const lang = useLang() as
|
|
14
|
-
const key =
|
|
13
|
+
const lang = useLang() as Language;
|
|
14
|
+
const key = AsyncData.Models;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const filters = computed(() => Object.entries(route.query)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IMultiSuggest } from '../../types';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
@@ -12,9 +12,9 @@ export async function useFetchMultiSuggest(
|
|
|
12
12
|
) {
|
|
13
13
|
const route = useRoute();
|
|
14
14
|
const searchValue = useState<string>('searchValue', () => '');
|
|
15
|
-
const lang = useLang() as
|
|
15
|
+
const lang = useLang() as Language;
|
|
16
16
|
const slug = useSlug();
|
|
17
|
-
const key = watchRoute ?
|
|
17
|
+
const key = watchRoute ? AsyncData.MultiSuggestRouteSearch : AsyncData.MultiSuggestSearch;
|
|
18
18
|
const stateKey = computed(() => `data-${key}-${watchRoute ? slug.value : searchValue.value}-${lang}`);
|
|
19
19
|
|
|
20
20
|
const { data, status } = await useAsyncData<IMultiSuggest | null>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useRoute } from 'vue-router';
|
|
2
|
-
import {
|
|
2
|
+
import { AsyncData, type Language } from '../../runtime';
|
|
3
3
|
import type { IPlaylistData } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchPlaylistsById = async (apiMethod: (...args: any[]) => Promise<IPlaylistData>) => {
|
|
6
6
|
const route = useRoute();
|
|
7
7
|
const id = computed(() => String(route.params['playlistId']));
|
|
8
|
-
const key =
|
|
8
|
+
const key = AsyncData.PlaylistById;
|
|
9
9
|
const stateKey = computed(() => `data-${key}-${id.value}`);
|
|
10
|
-
const lang = useLang() as
|
|
10
|
+
const lang = useLang() as Language;
|
|
11
11
|
|
|
12
12
|
const { data, status, error, refresh } = await useAsyncData<IPlaylistData>(
|
|
13
13
|
key,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRoute } from 'vue-router';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { Language } from '../../runtime';
|
|
3
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
4
4
|
import { sortPlaylists } from '../../lib';
|
|
5
5
|
import type { IPlaylistCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
@@ -8,8 +8,8 @@ export const useFetchPlaylistsByNiche = async (apiMethod: (...args: any[]) => Pr
|
|
|
8
8
|
const route = useRoute();
|
|
9
9
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
10
10
|
const perPage = mobile ? 12 : 48;
|
|
11
|
-
const lang = useLang() as
|
|
12
|
-
const key =
|
|
11
|
+
const lang = useLang() as Language;
|
|
12
|
+
const key = AsyncData.GetPlaylistsByNiche;
|
|
13
13
|
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
14
14
|
|
|
15
15
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IPlaylistCard>>(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsyncData, type Language } from '../../runtime';
|
|
2
2
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
3
3
|
import { useRoute } from 'vue-router';
|
|
4
4
|
|
|
@@ -10,9 +10,9 @@ export const useFetchPlaylistsGetVideosById = async (
|
|
|
10
10
|
const perPage = mobile ? 12 : 48;
|
|
11
11
|
const route = useRoute();
|
|
12
12
|
const id = computed(() => String(route.params['playlistId']));
|
|
13
|
-
const key =
|
|
13
|
+
const key = AsyncData.GetPlaylistsVideo;
|
|
14
14
|
const stateKey = computed(() => `data-${key}-${id.value}`);
|
|
15
|
-
const lang = useLang() as
|
|
15
|
+
const lang = useLang() as Language;
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
18
18
|
key,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IPopularTags } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchPopularTagsByChannelName = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IPopularTags[]>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug('channel');
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.PopularTagsByChannel;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const { data, status, error } = await useAsyncData<IPopularTags[]>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IPopularTags } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchPopularTagsByModelName = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IPopularTags[]>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug();
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.PopularTagsByModel;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const { data, status, error } = await useAsyncData<IPopularTags[]>(
|