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
|
@@ -5,48 +5,48 @@ import { useRoute } from 'vue-router';
|
|
|
5
5
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
7
7
|
export const useFetchModelsByLetter = async (
|
|
8
|
-
|
|
8
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>
|
|
9
9
|
) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
|
+
const perPage = mobile ? 12 : 48;
|
|
13
|
+
const slug = useSlug();
|
|
14
|
+
const lang = useLang() as Language;
|
|
15
|
+
const key = AsyncData.ModelsByFirstLetter;
|
|
16
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const filters = computed(() => Object.entries(route.query)
|
|
19
|
+
.filter(([key]) => key.startsWith('filter_'))
|
|
20
|
+
.map(([key, value]) => ({
|
|
21
|
+
name: key.replace(/^filter_/, ''),
|
|
22
|
+
value: Array.isArray(value) ? value[0] : (value as string),
|
|
23
|
+
})));
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
const { data, status, refresh } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
26
|
+
stateKey.value,
|
|
27
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
28
|
+
stateKey.value,
|
|
29
|
+
apiMethod,
|
|
30
|
+
lang,
|
|
31
|
+
{
|
|
32
|
+
page: Number(route.query.page) || 1,
|
|
33
|
+
'per-page': perPage,
|
|
34
|
+
},
|
|
35
|
+
getSelectedQuery(route, sortModels) || 'rank',
|
|
36
|
+
unref(filters),
|
|
37
|
+
unref(slug),
|
|
38
|
+
)(),
|
|
39
|
+
{
|
|
40
|
+
watch: [
|
|
41
|
+
() => {
|
|
42
|
+
if (route.query) {
|
|
43
|
+
const currentQuery = route.query;
|
|
44
|
+
return JSON.stringify(currentQuery);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
return { data, status, refresh };
|
|
52
52
|
};
|
|
@@ -4,39 +4,39 @@ import type { IModelCard, PaginatedResponse } from '../../types';
|
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
6
6
|
export const useFetchModelsByPhrases = async (
|
|
7
|
-
|
|
7
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>
|
|
8
8
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const route = useRoute();
|
|
10
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
|
+
const perPage = mobile ? 12 : 48;
|
|
12
|
+
const lang = useLang() as Language;
|
|
13
|
+
const slug = useSlug();
|
|
14
|
+
const key = AsyncData.ModelsByPhrases;
|
|
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
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
20
|
+
stateKey.value,
|
|
21
|
+
apiMethod,
|
|
22
|
+
{
|
|
23
|
+
page: Number(route.query['page']) || 1,
|
|
24
|
+
'per-page': perPage,
|
|
25
|
+
},
|
|
26
|
+
lang,
|
|
27
|
+
slug.value,
|
|
28
|
+
)(),
|
|
29
|
+
{
|
|
30
|
+
watch: [
|
|
31
|
+
() => {
|
|
32
|
+
if (route.query) {
|
|
33
|
+
const currentQuery = route.query;
|
|
34
|
+
return JSON.stringify(currentQuery);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
return { data, status, error };
|
|
42
42
|
};
|
|
@@ -3,31 +3,31 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchRelatedModels = async (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>,
|
|
7
|
+
limit: number,
|
|
8
|
+
cacheId: string
|
|
9
9
|
) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const lang = useLang() as Language;
|
|
11
|
+
const slug = useSlug();
|
|
12
|
+
const key = AsyncData.TopModelsMore;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${cacheId}-${lang}`);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
const { data, status, refresh } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
16
|
+
stateKey.value,
|
|
17
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
apiMethod,
|
|
20
|
+
slug.value,
|
|
21
|
+
limit,
|
|
22
|
+
0,
|
|
23
|
+
lang,
|
|
24
|
+
cacheId
|
|
25
|
+
)(),
|
|
26
|
+
);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
return {
|
|
29
|
+
data,
|
|
30
|
+
refresh,
|
|
31
|
+
status,
|
|
32
|
+
};
|
|
33
33
|
};
|
|
@@ -5,46 +5,46 @@ import { useRoute } from 'vue-router';
|
|
|
5
5
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
7
7
|
export const useFetchModels = async (
|
|
8
|
-
|
|
8
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>
|
|
9
9
|
) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 key = AsyncData.Models;
|
|
15
|
+
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const filters = computed(() => Object.entries(route.query)
|
|
18
|
+
.filter(([key]) => key.startsWith('filter_'))
|
|
19
|
+
.map(([key, value]) => ({
|
|
20
|
+
name: key.replace(/^filter_/, ''),
|
|
21
|
+
value: Array.isArray(value) ? value[0] : (value as string),
|
|
22
|
+
})));
|
|
23
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
|
-
|
|
24
|
+
const { data, status, refresh } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
25
|
+
key,
|
|
26
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
27
|
+
stateKey.value,
|
|
28
|
+
apiMethod,
|
|
29
|
+
lang,
|
|
30
|
+
{
|
|
31
|
+
page: Number(route.query.page) || 1,
|
|
32
|
+
'per-page': perPage,
|
|
33
|
+
},
|
|
34
|
+
getSelectedQuery(route, sortModels) || 'rank',
|
|
35
|
+
unref(filters)
|
|
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, refresh };
|
|
50
50
|
};
|
|
@@ -4,34 +4,34 @@ import type { IMultiSuggest } from '../../types';
|
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
6
6
|
export async function useFetchMultiSuggest(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
apiMethod: (...args: any[]) => Promise<IMultiSuggest | null>,
|
|
8
|
+
phrasesLimit: number,
|
|
9
|
+
modelsLimit: number,
|
|
10
|
+
categoriesLimit: number,
|
|
11
|
+
watchRoute = false
|
|
12
12
|
) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const route = useRoute();
|
|
14
|
+
const searchValue = useState<string>('searchValue', () => '');
|
|
15
|
+
const lang = useLang() as Language;
|
|
16
|
+
const slug = useSlug();
|
|
17
|
+
const key = watchRoute ? AsyncData.MultiSuggestRouteSearch : AsyncData.MultiSuggestSearch;
|
|
18
|
+
const stateKey = computed(() => `data-${key}-${watchRoute ? slug.value : searchValue.value}-${lang}`);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
const { data, status } = await useAsyncData<IMultiSuggest | null>(
|
|
21
|
+
key,
|
|
22
|
+
() => useApiFetcher<IMultiSuggest | null>(
|
|
23
|
+
stateKey.value,
|
|
24
|
+
apiMethod,
|
|
25
|
+
lang,
|
|
26
|
+
watchRoute ? slug.value : searchValue.value,
|
|
27
|
+
phrasesLimit,
|
|
28
|
+
modelsLimit,
|
|
29
|
+
categoriesLimit
|
|
30
|
+
)(),
|
|
31
|
+
{
|
|
32
|
+
watch: [() => watchRoute ? String(route.params?.slug) : searchValue.value],
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
return { data, status };
|
|
37
37
|
}
|
|
@@ -3,21 +3,21 @@ 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const route = useRoute();
|
|
7
|
+
const id = computed(() => String(route.params['playlistId']));
|
|
8
|
+
const key = AsyncData.PlaylistById;
|
|
9
|
+
const stateKey = computed(() => `data-${key}-${id.value}`);
|
|
10
|
+
const lang = useLang() as Language;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const { data, status, error, refresh } = await useAsyncData<IPlaylistData>(
|
|
13
|
+
stateKey.value,
|
|
14
|
+
() => useApiFetcher<IPlaylistData>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
apiMethod,
|
|
17
|
+
id.value,
|
|
18
|
+
lang
|
|
19
|
+
)(),
|
|
20
|
+
);
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
return { data, status, error, refresh };
|
|
23
23
|
};
|
|
@@ -5,36 +5,36 @@ import { sortPlaylists } from '../../lib';
|
|
|
5
5
|
import type { IPlaylistCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
7
7
|
export const useFetchPlaylistsByNiche = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IPlaylistCard>>) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 key = AsyncData.GetPlaylistsByNiche;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
15
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IPlaylistCard>>(
|
|
16
|
+
key,
|
|
17
|
+
() => useApiFetcher<PaginatedResponse<IPlaylistCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
apiMethod,
|
|
20
|
+
{
|
|
21
|
+
page: Number(route.query['page']) || 1,
|
|
22
|
+
'per-page': perPage,
|
|
23
|
+
},
|
|
24
|
+
getSelectedQuery(route, sortPlaylists) || '-views',
|
|
25
|
+
lang,
|
|
26
|
+
)(),
|
|
27
|
+
{
|
|
28
|
+
watch: [
|
|
29
|
+
() => {
|
|
30
|
+
if (route.query) {
|
|
31
|
+
const currentQuery = route.query;
|
|
32
|
+
return JSON.stringify(currentQuery);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
return { data, status, error };
|
|
40
40
|
};
|
|
@@ -3,36 +3,36 @@ import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
|
3
3
|
import { useRoute } from 'vue-router';
|
|
4
4
|
|
|
5
5
|
export const useFetchPlaylistsGetVideosById = async (
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>,
|
|
7
|
+
isListPage?: boolean
|
|
8
8
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
10
|
+
const perPage = mobile ? 12 : 48;
|
|
11
|
+
const route = useRoute();
|
|
12
|
+
const id = computed(() => String(route.params['playlistId']));
|
|
13
|
+
const key = AsyncData.GetPlaylistsVideo;
|
|
14
|
+
const stateKey = computed(() => `data-${key}-${id.value}`);
|
|
15
|
+
const lang = useLang() as Language;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
() => useApiFetcherNoCache<PaginatedResponse<IVideoCard>>(
|
|
20
|
+
stateKey.value,
|
|
21
|
+
apiMethod,
|
|
22
|
+
id.value,
|
|
23
|
+
isListPage ? {
|
|
24
|
+
page: Number(route.query['page']) || 1,
|
|
25
|
+
['per-page']: perPage,
|
|
26
|
+
} : {
|
|
27
|
+
page: 1,
|
|
28
|
+
},
|
|
29
|
+
lang,
|
|
30
|
+
)(),
|
|
31
|
+
);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
return {
|
|
34
|
+
error,
|
|
35
|
+
status,
|
|
36
|
+
data,
|
|
37
|
+
};
|
|
38
38
|
};
|
|
@@ -2,17 +2,17 @@ import type { Language } from '../../runtime';
|
|
|
2
2
|
import { AsyncData } from '../../runtime';
|
|
3
3
|
|
|
4
4
|
export const useFetchRelatedSearch = async (apiMethod: (...args: any[]) => Promise<Array<string>>) => {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const lang = useLang() as Language;
|
|
6
|
+
const key = AsyncData.RelatedSearch;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
const { data, status, error } = await useAsyncData<Array<string>>(
|
|
9
|
+
key,
|
|
10
|
+
() => useApiFetcher<Array<string>>(
|
|
11
|
+
null,
|
|
12
|
+
apiMethod,
|
|
13
|
+
lang,
|
|
14
|
+
)(),
|
|
15
|
+
);
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
return { data, status, error };
|
|
18
18
|
};
|
|
@@ -4,36 +4,36 @@ import { AsyncData } from '../../runtime';
|
|
|
4
4
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
5
5
|
|
|
6
6
|
export const useFetchRelatedVideos = async (
|
|
7
|
-
|
|
7
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>
|
|
8
8
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
|
+
const perPage = mobile ? 6 : 14;
|
|
13
|
+
const slug = useSlug();
|
|
14
|
+
const key = AsyncData.RelatedVideos;
|
|
15
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
() => {
|
|
20
|
+
if (!slug.value) return Promise.resolve(null as unknown as PaginatedResponse<IVideoCard>);
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
page: Number(route.query['page']) || 1,
|
|
27
|
-
'per-page': perPage,
|
|
28
|
-
},
|
|
29
|
-
lang,
|
|
30
|
-
slug.value
|
|
31
|
-
)();
|
|
32
|
-
},
|
|
22
|
+
return useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
23
|
+
stateKey.value,
|
|
24
|
+
apiMethod,
|
|
33
25
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
page: Number(route.query['page']) || 1,
|
|
27
|
+
'per-page': perPage,
|
|
28
|
+
},
|
|
29
|
+
lang,
|
|
30
|
+
slug.value
|
|
31
|
+
)();
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
watch: [() => route.query.page],
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
return { data, status, error };
|
|
39
39
|
};
|