itube-specs 0.0.785 → 0.0.786

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.
Files changed (24) hide show
  1. package/composables/fetch/use-fetch-categories-by-letter.ts +1 -1
  2. package/composables/fetch/use-fetch-categories-by-name.ts +1 -1
  3. package/composables/fetch/use-fetch-categories-by-phrase.ts +1 -1
  4. package/composables/fetch/use-fetch-categories-related.ts +1 -1
  5. package/composables/fetch/use-fetch-channels-by-model.ts +1 -1
  6. package/composables/fetch/use-fetch-channels-by-name.ts +1 -1
  7. package/composables/fetch/use-fetch-channels-by-network-name.ts +1 -1
  8. package/composables/fetch/use-fetch-model-by-name.ts +1 -1
  9. package/composables/fetch/use-fetch-models-by-phrases.ts +1 -1
  10. package/composables/fetch/use-fetch-playlists-by-id.ts +1 -1
  11. package/composables/fetch/use-fetch-playlists-get-videos-by-id.ts +1 -1
  12. package/composables/fetch/use-fetch-popular-tags-by-channel-name.ts +1 -1
  13. package/composables/fetch/use-fetch-popular-tags-by-model-name.ts +1 -1
  14. package/composables/fetch/use-fetch-related-videos.ts +1 -1
  15. package/composables/fetch/use-fetch-video-referer-phrases.ts +1 -1
  16. package/composables/fetch/use-fetch-videos-by-categories.ts +8 -7
  17. package/composables/fetch/use-fetch-videos-by-channel.ts +1 -1
  18. package/composables/fetch/use-fetch-videos-by-model-and-channel.ts +1 -1
  19. package/composables/fetch/use-fetch-videos-by-model-and-tag.ts +1 -1
  20. package/composables/fetch/use-fetch-videos-by-model.ts +1 -1
  21. package/composables/fetch/use-fetch-videos-by-tag.ts +1 -1
  22. package/composables/fetch/use-fetch-videos-search-by-niche.ts +1 -1
  23. package/composables/fetch/use-fetch-videos.ts +4 -1
  24. package/package.json +1 -1
@@ -11,7 +11,7 @@ export const useFetchCategoriesByLetter = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<Array<ICategoryCard>>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<Array<ICategoryCard>>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchCategoriesByName = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<ICardInfo>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<ICardInfo>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchCategoriesByPhrase = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<Array<IChipsItem>>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<Array<IChipsItem>>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchCategoriesRelated = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<IRelatedPhrases>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<IRelatedPhrases>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchChannelsByModel = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<PaginatedResponse<IChannelCard>>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchChannelsByName = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<ICardInfo>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<ICardInfo>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -15,7 +15,7 @@ export const useFetchChannelsByNetworkName = async (
15
15
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
16
16
 
17
17
  const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
18
- key,
18
+ stateKey.value,
19
19
  () => useApiFetcher<PaginatedResponse<IChannelCard>>(
20
20
  stateKey.value,
21
21
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchModelByName = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<ICardInfo>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<ICardInfo>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -15,7 +15,7 @@ export const useFetchModelsByPhrases = async (
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>>(
18
- key,
18
+ stateKey.value,
19
19
  () => useApiFetcher<PaginatedResponse<IModelCard>>(
20
20
  stateKey.value,
21
21
  apiMethod,
@@ -10,7 +10,7 @@ export const useFetchPlaylistsById = async (apiMethod: (...args: any[]) => Promi
10
10
  const lang = useLang() as Language;
11
11
 
12
12
  const { data, status, error, refresh } = await useAsyncData<IPlaylistData>(
13
- key,
13
+ stateKey.value,
14
14
  () => useApiFetcher<IPlaylistData>(
15
15
  stateKey.value,
16
16
  apiMethod,
@@ -15,7 +15,7 @@ export const useFetchPlaylistsGetVideosById = async (
15
15
  const lang = useLang() as Language;
16
16
 
17
17
  const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
18
- key,
18
+ stateKey.value,
19
19
  () => useApiFetcherNoCache<PaginatedResponse<IVideoCard>>(
20
20
  stateKey.value,
21
21
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchPopularTagsByChannelName = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<IPopularTags[]>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<IPopularTags[]>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -11,7 +11,7 @@ export const useFetchPopularTagsByModelName = async (
11
11
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
12
12
 
13
13
  const { data, status, error } = await useAsyncData<IPopularTags[]>(
14
- key,
14
+ stateKey.value,
15
15
  () => useApiFetcher<IPopularTags[]>(
16
16
  stateKey.value,
17
17
  apiMethod,
@@ -15,7 +15,7 @@ export const useFetchRelatedVideos = async (
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<IVideoCard>>(
18
- key,
18
+ stateKey.value,
19
19
  () => {
20
20
  if (!slug.value) return Promise.resolve(null as unknown as PaginatedResponse<IVideoCard>);
21
21
 
@@ -9,7 +9,7 @@ export const useFetchVideoRefererPhrases = async (
9
9
  const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
10
10
 
11
11
  const { data, status, error } = await useAsyncData<string[]>(
12
- key,
12
+ stateKey.value,
13
13
  () => useApiFetcher<string[]>(
14
14
  stateKey.value,
15
15
  apiMethod,
@@ -16,8 +16,14 @@ export const useFetchVideosByCategories = async (
16
16
  const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
17
17
  const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
18
18
 
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 дёрнул бы этот эндпоинт с чужим слагом.
19
25
  const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
20
- key,
26
+ stateKey.value,
21
27
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
22
28
  stateKey.value,
23
29
  apiMethod,
@@ -31,12 +37,7 @@ export const useFetchVideosByCategories = async (
31
37
  getSelectedQuery(route, sortItemsDefault) || '-popularity'
32
38
  )(),
33
39
  {
34
- watch: [() => {
35
- if (route.query) {
36
- const currentQuery = route.query;
37
- return JSON.stringify(currentQuery);
38
- }
39
- }],
40
+ watch: [() => JSON.stringify(route.query)],
40
41
  }
41
42
  );
42
43
 
@@ -15,7 +15,7 @@ export const useFetchVideosByChannel = async (apiMethod: (...args: any[]) => Pro
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<IVideoCard>>(
18
- key,
18
+ stateKey.value,
19
19
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
20
20
  stateKey.value,
21
21
  apiMethod,
@@ -20,7 +20,7 @@ export const useFetchVideosByModelAndChannel = async (apiMethod: (...args: any[]
20
20
  const stateKey = computed(() => `data-${key}-${slug.value}-${channel.value}-${JSON.stringify(route.query)}-${lang}`);
21
21
 
22
22
  const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
23
- key,
23
+ stateKey.value,
24
24
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
25
25
  stateKey.value,
26
26
  apiMethod,
@@ -20,7 +20,7 @@ export const useFetchVideosByModelAndTag = async (apiMethod: (...args: any[]) =>
20
20
  const stateKey = computed(() => `data-${key}-${slug.value}-${tag.value}-${JSON.stringify(route.query)}-${lang}`);
21
21
 
22
22
  const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
23
- key,
23
+ stateKey.value,
24
24
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
25
25
  stateKey.value,
26
26
  apiMethod,
@@ -15,7 +15,7 @@ export const useFetchVideosByModel = async (apiMethod: (...args: any[]) => Promi
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<IVideoCard>>(
18
- key,
18
+ stateKey.value,
19
19
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
20
20
  stateKey.value,
21
21
  apiMethod,
@@ -15,7 +15,7 @@ export const useFetchVideosByTag = async (apiMethod: (...args: any[]) => Promise
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<IVideoCard>>(
18
- key,
18
+ stateKey.value,
19
19
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
20
20
  stateKey.value,
21
21
  apiMethod,
@@ -13,7 +13,7 @@ export const useFetchVideosSearchByNiche = async (apiMethod: (...args: any[]) =>
13
13
  const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
14
14
 
15
15
  const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
16
- key,
16
+ stateKey.value,
17
17
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
18
18
  stateKey.value,
19
19
  apiMethod,
@@ -16,8 +16,11 @@ export const useFetchVideos = async (
16
16
  const key = AsyncData.Videos;
17
17
  const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
18
18
 
19
+ // Ключ уникален на query+lang (не константа AsyncData.Videos): иначе главная делит один
20
+ // кэш-слот между разными query (page/sort/фильтры) и при возврате на неё отдаётся кэш от
21
+ // другого состояния вместо свежего фетча (мигает «нет данных»/пустой грид).
19
22
  const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
20
- key,
23
+ stateKey.value,
21
24
  () => useApiFetcher<PaginatedResponse<IVideoCard>>(
22
25
  stateKey.value,
23
26
  apiMethod,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.785",
4
+ "version": "0.0.786",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {