itube-specs 0.0.795 → 0.0.796
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/fetch/use-fetch-categories-by-letter.ts +15 -15
- package/composables/fetch/use-fetch-categories-by-phrase.ts +18 -18
- package/composables/fetch/use-fetch-categories-group-by-letter.ts +13 -13
- package/composables/fetch/use-fetch-channels-by-model.ts +18 -18
- package/composables/fetch/use-fetch-channels-by-name.ts +15 -15
- package/composables/fetch/use-fetch-channels-by-network-name.ts +30 -30
- package/composables/fetch/use-fetch-channels.ts +31 -31
- package/composables/fetch/use-fetch-dictionaries-countries.ts +13 -13
- package/composables/fetch/use-fetch-dictionaries-genders.ts +13 -13
- package/composables/fetch/use-fetch-groups-categories-lazy.ts +15 -15
- package/composables/fetch/use-fetch-groups-categories.ts +13 -13
- package/composables/fetch/use-fetch-model-by-name.ts +15 -15
- package/composables/fetch/use-fetch-models-by-category.ts +17 -17
- package/composables/fetch/use-fetch-models-by-channel.ts +17 -17
- package/composables/fetch/use-fetch-models-by-letter.ts +40 -40
- package/composables/fetch/use-fetch-models-by-phrases.ts +32 -32
- package/composables/fetch/use-fetch-models-by-tag.ts +1 -1
- package/composables/fetch/use-fetch-models-related.ts +24 -24
- package/composables/fetch/use-fetch-models.ts +38 -38
- package/composables/fetch/use-fetch-multi-suggest.ts +27 -27
- package/composables/fetch/use-fetch-playlists-by-id.ts +15 -15
- package/composables/fetch/use-fetch-playlists-by-niche.ts +30 -30
- package/composables/fetch/use-fetch-playlists-get-videos-by-id.ts +29 -29
- package/composables/fetch/use-fetch-related-searches.ts +11 -11
- package/composables/fetch/use-fetch-related-videos.ts +27 -27
- package/composables/fetch/use-fetch-top-chips-models.ts +15 -15
- package/composables/fetch/use-fetch-top-models.ts +19 -19
- package/composables/fetch/use-fetch-top-random-categories.ts +13 -13
- package/composables/fetch/use-fetch-top-random-full.ts +17 -17
- package/composables/fetch/use-fetch-video-referer-phrases.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-categories.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-channel.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-model-and-channel.ts +40 -40
- package/composables/fetch/use-fetch-videos-by-model-and-tag.ts +40 -40
- package/composables/fetch/use-fetch-videos-by-model.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-tag.ts +34 -34
- package/composables/fetch/use-fetch-videos-search-by-niche.ts +32 -32
- package/composables/use-api-fetcher-no-cache.ts +24 -24
- package/composables/use-api-fetcher.ts +19 -19
- package/composables/use-get-videos-filter-request.ts +28 -28
- package/composables/use-lang.ts +8 -8
- package/composables/use-meta.ts +54 -54
- package/composables/use-noindex.ts +8 -8
- package/composables/use-report-popup.ts +19 -19
- package/lib/contact-forms-scheme.ts +92 -92
- package/lib/contacts/report-issue-items.ts +3 -3
- package/lib/contacts/report-malware-items.ts +4 -4
- package/lib/contacts/report-reasons-items.ts +10 -10
- package/lib/contacts/report-wrong-items.ts +4 -4
- package/lib/report-forms-scheme.ts +259 -259
- package/lib/scheme/categories-navigation.ts +8 -8
- package/lib/scheme/select-added-items.ts +41 -41
- package/lib/scheme/select-duration-items.ts +35 -35
- package/nuxt.config.ts +18 -18
- package/package.json +1 -1
- package/runtime/constants/adverts.ts +5 -5
- package/runtime/constants/async-data.ts +57 -57
- package/runtime/constants/languages.ts +12 -12
- package/runtime/constants/niche.ts +3 -3
- package/runtime/constants/playlist-type.ts +2 -2
- package/runtime/utils/check-device-width.ts +18 -18
- package/runtime/utils/cleaners/clean-mini-category-card.ts +5 -5
- package/runtime/utils/cleaners/clean-model-card.ts +20 -20
- package/runtime/utils/cleaners/clean-video-data.ts +50 -50
- package/runtime/utils/converters/convert-date-to-timestamp.ts +22 -22
- package/runtime/utils/converters/convert-query-categories.ts +2 -2
- package/runtime/utils/converters/convert-string-array-to-chips.ts +6 -6
- package/runtime/utils/converters/convert-string.ts +0 -0
- package/runtime/utils/server/age.ts +55 -55
- package/runtime/utils/server/api-helper.ts +26 -26
- package/runtime/utils/server/get-url-with-proxied-params.ts +3 -3
- package/runtime/utils/server/server-api-helper.ts +15 -15
- package/runtime/utils/validate-email.ts +2 -2
- package/services/api/categories.service.ts +222 -222
- package/services/api/dictionaries.service.ts +28 -28
- package/services/api/models.service.ts +297 -297
- package/types/authorization-forms.d.ts +8 -8
- package/types/burger-menu-item.d.ts +5 -5
- package/types/change-email-form.d.ts +1 -1
- package/types/change-password-form.d.ts +2 -2
- package/types/chips-item.d.ts +8 -8
- package/types/contacts-scheme.d.ts +9 -9
- package/types/country.d.ts +5 -5
- package/types/fluid-player.d.ts +176 -176
- package/types/gender.d.ts +4 -4
- package/types/group-categories.d.ts +10 -10
- package/types/info-chips.d.ts +2 -2
- package/types/model-card.d.ts +15 -15
- package/types/model-filter-payload.d.ts +2 -2
- package/types/model-filter.d.ts +10 -10
- package/types/model-group.d.ts +4 -4
- package/types/model-tag.d.ts +3 -3
- package/types/playlist-short.d.ts +2 -2
- package/types/playlist-video-form.d.ts +7 -7
- package/types/popular-tags.d.ts +2 -2
- package/types/raw/raw-playlist-user.d.ts +20 -20
- package/types/raw/raw-thumbs-urls.d.ts +2 -2
- package/types/raw/raw-video-card.d.ts +70 -70
- package/types/raw/raw-video-data.d.ts +50 -50
- package/types/recovery-password-form.d.ts +2 -2
- package/types/report-request.d.ts +2 -2
- package/types/report-scheme.d.ts +18 -18
- package/types/request-filters.d.ts +10 -10
- package/types/request-pagination.d.ts +2 -2
- package/types/search-top-models.d.ts +4 -4
- package/types/site.d.ts +15 -15
- package/types/thumbs-urls.d.ts +1 -1
|
@@ -3,21 +3,21 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IModelTag } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchTopChipsModels = async (apiMethod: (...args: any[]) => Promise<IModelTag[]>, cacheId: string) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const lang = useLang() as Language;
|
|
7
|
+
const key = AsyncData.TopChipsModels;
|
|
8
|
+
const stateKey = computed(() => `data-${key}-${cacheId}-${lang}`);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
const { data: topChipsModels, refresh, status } = await useAsyncData<IModelTag[]>(
|
|
11
|
+
stateKey.value,
|
|
12
|
+
() => useApiFetcher<IModelTag[]>(
|
|
13
|
+
stateKey.value,
|
|
14
|
+
apiMethod,
|
|
15
|
+
20,
|
|
16
|
+
0,
|
|
17
|
+
lang,
|
|
18
|
+
cacheId,
|
|
19
|
+
)(),
|
|
20
|
+
);
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
return { topChipsModels, refresh, status };
|
|
23
23
|
};
|
|
@@ -2,25 +2,25 @@ import type { AsyncData, Language } from '../../runtime';
|
|
|
2
2
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
3
3
|
|
|
4
4
|
export const useFetchTopModels = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>, limit: number, eName: AsyncData | string, cacheId: string) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const lang = useLang() as Language;
|
|
6
|
+
const key = eName;
|
|
7
|
+
const stateKey = computed(() => `data-${key}-${cacheId}-${lang}`);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
const { data, status, refresh } = await useAsyncData(
|
|
10
|
+
stateKey.value,
|
|
11
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
12
|
+
stateKey.value,
|
|
13
|
+
apiMethod,
|
|
14
|
+
limit,
|
|
15
|
+
0,
|
|
16
|
+
lang,
|
|
17
|
+
cacheId
|
|
18
|
+
)(),
|
|
19
|
+
);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
return {
|
|
22
|
+
data,
|
|
23
|
+
refresh,
|
|
24
|
+
status,
|
|
25
|
+
};
|
|
26
26
|
};
|
|
@@ -3,19 +3,19 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IChipsItem } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchTopRandomCategories = async (apiMethod: (...args: any[]) => Promise<Array<IChipsItem>>, cacheId: string) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const lang = useLang() as Language;
|
|
7
|
+
const key = AsyncData.CategoriesTopRandom;
|
|
8
|
+
const stateKey = computed(() => `data-${key}-${cacheId}-${lang}`);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const { data: topRandomCategories, refresh, error } = await useAsyncData<Array<IChipsItem>>(
|
|
11
|
+
stateKey.value,
|
|
12
|
+
() => useApiFetcher<Array<IChipsItem>>(
|
|
13
|
+
stateKey.value,
|
|
14
|
+
apiMethod,
|
|
15
|
+
lang,
|
|
16
|
+
cacheId
|
|
17
|
+
)(),
|
|
18
|
+
);
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
return { topRandomCategories, refresh, error };
|
|
21
21
|
};
|
|
@@ -3,24 +3,24 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { ICategoryCard } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchTopRandomFull = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<Array<ICategoryCard>>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.CategoriesTopRandomFull;
|
|
10
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const { data, status, error } = await useAsyncData<Array<ICategoryCard>>(
|
|
13
|
+
AsyncData.CategoriesTopRandomFull,
|
|
14
|
+
() => useApiFetcher<Array<ICategoryCard>>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
apiMethod,
|
|
17
|
+
lang,
|
|
18
|
+
)(),
|
|
19
|
+
);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
return {
|
|
22
|
+
data,
|
|
23
|
+
status,
|
|
24
|
+
error,
|
|
25
|
+
};
|
|
26
26
|
};
|
|
@@ -2,41 +2,41 @@ import type { Language } from '../../runtime';
|
|
|
2
2
|
import { AsyncData } from '../../runtime';
|
|
3
3
|
|
|
4
4
|
export const useFetchVideoRefererPhrases = async (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
apiMethod: (...args: any[]) => Promise<string[]>) => {
|
|
6
|
+
const lang = useLang() as Language;
|
|
7
|
+
const slug = useSlug();
|
|
8
|
+
const key = AsyncData.RefererPhrases;
|
|
9
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
const { data, status, error } = await useAsyncData<string[]>(
|
|
12
|
+
stateKey.value,
|
|
13
|
+
() => useApiFetcher<string[]>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
apiMethod,
|
|
16
|
+
lang,
|
|
17
|
+
slug.value,
|
|
18
|
+
undefined
|
|
19
|
+
)(),
|
|
20
|
+
);
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
// async function fetchData() {
|
|
23
|
+
// try {
|
|
24
|
+
// const { $features } = useNuxtApp();
|
|
25
|
+
// const slug = convertString().fromSlug(String(route.params['slug'])) || '';
|
|
26
|
+
//
|
|
27
|
+
// if ($features.FetchByUrlEnabled) {
|
|
28
|
+
// return await VideosApiService.refererPhrasesByUrl(lang, slug, undefined);
|
|
29
|
+
// } else {
|
|
30
|
+
// return await VideosApiService.refererPhrasesById(lang, slug, undefined);
|
|
31
|
+
// }
|
|
32
|
+
// } catch (err) {
|
|
33
|
+
// throw createError({
|
|
34
|
+
// statusCode: 500,
|
|
35
|
+
// statusMessage: 'Error fetching video data',
|
|
36
|
+
// message: err instanceof Error ? err.message : 'An unknown error occurred',
|
|
37
|
+
// });
|
|
38
|
+
// }
|
|
39
|
+
// }
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
return { data, status, error };
|
|
42
42
|
};
|
|
@@ -5,41 +5,41 @@ import { useRoute } from 'vue-router';
|
|
|
5
5
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByCategories = async (
|
|
8
|
-
|
|
8
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>
|
|
9
9
|
) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
|
+
const perPage = mobile ? 12 : 48;
|
|
13
|
+
const lang = useLang() as Language;
|
|
14
|
+
const slug = useSlug();
|
|
15
|
+
const key = AsyncData.VideosByCategory;
|
|
16
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
17
|
+
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
// Ключ уникален на slug+query+lang (не константа AsyncData.VideosByCategory): иначе все
|
|
20
|
+
// категории делят один кэш-слот useAsyncData и при приходе на /categories/<slug>, когда
|
|
21
|
+
// слот уже заполнен другой категорией, отдаётся её кэш вместо свежего фетча (ролики «не
|
|
22
|
+
// подсасываются»). watch — только на query (page/sort/фильтры): следить за slug НЕЛЬЗЯ,
|
|
23
|
+
// т.к. route.params.slug общий для всех [slug]-роутов и при уходе на /videos/<id> и т.п.
|
|
24
|
+
// watch дёрнул бы этот эндпоинт с чужим слагом.
|
|
25
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
26
|
+
stateKey.value,
|
|
27
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
28
|
+
stateKey.value,
|
|
29
|
+
apiMethod,
|
|
30
|
+
lang,
|
|
31
|
+
{
|
|
32
|
+
page: Number(route.query['page']) || 1,
|
|
33
|
+
'per-page': perPage,
|
|
34
|
+
},
|
|
35
|
+
filters.value,
|
|
36
|
+
slug.value,
|
|
37
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
38
|
+
)(),
|
|
39
|
+
{
|
|
40
|
+
watch: [() => JSON.stringify(route.query)],
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
return { data, status, error };
|
|
45
45
|
};
|
|
@@ -5,40 +5,40 @@ import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../l
|
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByChannel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
10
|
+
const perPage = mobile ? 12 : 48;
|
|
11
|
+
const lang = useLang() as Language;
|
|
12
|
+
const slug = useSlug('channel');
|
|
13
|
+
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
14
|
+
const key = AsyncData.VideosByChannel;
|
|
15
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
20
|
+
stateKey.value,
|
|
21
|
+
apiMethod,
|
|
22
|
+
{
|
|
23
|
+
page: Number(route.query['page']) || 1,
|
|
24
|
+
'per-page': perPage,
|
|
25
|
+
},
|
|
26
|
+
filters.value,
|
|
27
|
+
slug.value,
|
|
28
|
+
lang,
|
|
29
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
30
|
+
)(),
|
|
31
|
+
{
|
|
32
|
+
watch: [
|
|
33
|
+
() => {
|
|
34
|
+
if (route.query) {
|
|
35
|
+
const currentQuery = route.query;
|
|
36
|
+
return JSON.stringify(currentQuery);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
return { data, status, error };
|
|
44
44
|
};
|
|
@@ -5,46 +5,46 @@ import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../l
|
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByModelAndChannel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
|
+
const perPage = mobile ? 12 : 48;
|
|
12
|
+
const slug = useSlug();
|
|
13
|
+
const channel = computed(() => {
|
|
14
|
+
const tagRaw = route.params['channel'];
|
|
15
|
+
const slug = convertString().fromSlug(String(tagRaw));
|
|
16
|
+
return Array.isArray(slug) ? slug[0] : slug;
|
|
17
|
+
});
|
|
18
|
+
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
19
|
+
const key = AsyncData.VideosByModelAndChannel;
|
|
20
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${channel.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
23
|
+
stateKey.value,
|
|
24
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
25
|
+
stateKey.value,
|
|
26
|
+
apiMethod,
|
|
27
|
+
{
|
|
28
|
+
page: Number(route.query['page']) || 1,
|
|
29
|
+
'per-page': perPage,
|
|
30
|
+
},
|
|
31
|
+
filters.value,
|
|
32
|
+
slug.value,
|
|
33
|
+
channel.value,
|
|
34
|
+
lang,
|
|
35
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
36
|
+
)(),
|
|
37
|
+
{
|
|
38
|
+
watch: [
|
|
39
|
+
() => {
|
|
40
|
+
if (route.query) {
|
|
41
|
+
const currentQuery = route.query;
|
|
42
|
+
return JSON.stringify(currentQuery);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
return { data, status, error };
|
|
50
50
|
};
|
|
@@ -5,46 +5,46 @@ import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../l
|
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByModelAndTag = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
10
|
+
const perPage = mobile ? 12 : 48;
|
|
11
|
+
const lang = useLang() as Language;
|
|
12
|
+
const slug = useSlug();
|
|
13
|
+
const tag = computed(() => {
|
|
14
|
+
const tagRaw = route.params['tag'];
|
|
15
|
+
const slug = convertString().fromSlug(String(tagRaw));
|
|
16
|
+
return Array.isArray(slug) ? slug[0] : slug;
|
|
17
|
+
});
|
|
18
|
+
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
19
|
+
const key = AsyncData.VideosByModelAndTag;
|
|
20
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${tag.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
23
|
+
stateKey.value,
|
|
24
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
25
|
+
stateKey.value,
|
|
26
|
+
apiMethod,
|
|
27
|
+
{
|
|
28
|
+
page: Number(route.query['page']) || 1,
|
|
29
|
+
'per-page': perPage,
|
|
30
|
+
},
|
|
31
|
+
filters.value,
|
|
32
|
+
slug.value,
|
|
33
|
+
tag.value,
|
|
34
|
+
lang,
|
|
35
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
36
|
+
)(),
|
|
37
|
+
{
|
|
38
|
+
watch: [
|
|
39
|
+
() => {
|
|
40
|
+
if (route.query) {
|
|
41
|
+
const currentQuery = route.query;
|
|
42
|
+
return JSON.stringify(currentQuery);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
return { data, status, error };
|
|
50
50
|
};
|
|
@@ -5,40 +5,40 @@ import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../l
|
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByModel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
|
+
const perPage = mobile ? 12 : 48;
|
|
12
|
+
const slug = useSlug();
|
|
13
|
+
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
14
|
+
const key = AsyncData.ModelsVideos;
|
|
15
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
20
|
+
stateKey.value,
|
|
21
|
+
apiMethod,
|
|
22
|
+
{
|
|
23
|
+
page: Number(route.query['page']) || 1,
|
|
24
|
+
'per-page': perPage,
|
|
25
|
+
},
|
|
26
|
+
filters.value,
|
|
27
|
+
slug.value,
|
|
28
|
+
lang,
|
|
29
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
30
|
+
)(),
|
|
31
|
+
{
|
|
32
|
+
watch: [
|
|
33
|
+
() => {
|
|
34
|
+
if (route.query) {
|
|
35
|
+
const currentQuery = route.query;
|
|
36
|
+
return JSON.stringify(currentQuery);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
return { data, status, error };
|
|
44
44
|
};
|