itube-specs 0.0.302 → 0.0.304

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.
@@ -6,7 +6,7 @@ export const useFetchPlaylistsById = async (apiMethod: (...args: any[]) => Promi
6
6
  const route = useRoute();
7
7
  const id = computed(() => String(route.params['id']));
8
8
  const key = EAsyncData.PlaylistById;
9
- const stateKey = computed(() => `data-${key}-${id.value}-${JSON.stringify(route.query)}`);
9
+ const stateKey = computed(() => `data-${key}-${id.value}`);
10
10
 
11
11
  const { data, status, error, refresh } = await useAsyncData<IPlaylistInfoType>(
12
12
  key,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.302",
4
+ "version": "0.0.304",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -1,9 +1,9 @@
1
1
  import type { IRawCategoryCard, ICategoryCard } from '../../../types';
2
2
 
3
3
  export const cleanCategoryCard = (card: IRawCategoryCard): ICategoryCard => ({
4
- name: card.name,
5
- title: card.title,
6
- videosCount: card.videosCount,
7
- thumbUrl: card.video_thumb_urls?.webp?.['480x270'],
8
- guid: card.guid,
4
+ name: card.name || '',
5
+ title: card.title || '',
6
+ videosCount: card.videosCount || 0,
7
+ thumbUrl: card.video_thumb_urls?.webp?.['480x270'] || '',
8
+ guid: card.guid || '',
9
9
  })
@@ -1,9 +1,9 @@
1
1
  import type { IRawCategoryInfo, ICardInfo } from '../../../types';
2
2
 
3
3
  export const cleanCategoryInfo = (card: IRawCategoryInfo): ICardInfo => ({
4
- guid: card.guid,
5
- title: card.title,
6
- videosCount: card.videosCount,
7
- description: card.description,
8
- thumbUrl: card.video_thumb_urls?.webp?.['480x270'],
4
+ guid: card.guid || '',
5
+ title: card.title || '',
6
+ videosCount: card.videosCount || 0,
7
+ description: card.description || '',
8
+ thumbUrl: card.video_thumb_urls?.webp?.['480x270'] || '',
9
9
  })
@@ -1,12 +1,12 @@
1
1
  import type { IChannelCard, IRawChannelCard } from '../../../types';
2
2
 
3
3
  export const cleanChannelCard = (card: IRawChannelCard): IChannelCard => ({
4
- guid: card.guid,
5
- name: card.name,
6
- url: card.url,
7
- videosCount: card.videos_count,
8
- isNetwork: card.is_network,
9
- updated: card.updated,
10
- avatarUrl: card.avatar_url,
11
- thumbUrl: card.video_thumb_urls.webp?.['480x270'],
4
+ guid: card.guid || '',
5
+ name: card.name || '',
6
+ url: card.url || '',
7
+ videosCount: card.videos_count || 0,
8
+ isNetwork: card.is_network || false,
9
+ updated: card.updated || 0,
10
+ avatarUrl: card.avatar_url || '',
11
+ thumbUrl: card.video_thumb_urls.webp?.['480x270'] || '',
12
12
  })
@@ -1,13 +1,13 @@
1
1
  import type { IRawChannelInfo, ICardInfo } from '../../../types';
2
2
 
3
3
  export const cleanChannelInfo = (card: IRawChannelInfo): ICardInfo => ({
4
- guid: card.guid,
5
- title: card.name,
6
- url: card.url,
7
- description: card.description,
8
- videosCount: card.videos_count,
9
- isNetwork: card.is_network,
10
- updated: card.updated,
11
- avatarUrl: card.avatar_url,
12
- thumbUrl: card.video_thumb_urls.webp?.['480x270'],
4
+ guid: card.guid || '',
5
+ title: card.name || '',
6
+ url: card.url || '',
7
+ description: card.description || '',
8
+ videosCount: card.videos_count || 0,
9
+ isNetwork: card.is_network || false,
10
+ updated: card.updated || 0,
11
+ avatarUrl: card.avatar_url || '',
12
+ thumbUrl: card.video_thumb_urls.webp?.['480x270'] || '',
13
13
  })
@@ -1,11 +1,11 @@
1
1
  import type { IRawModelInfo, ICardInfo } from '../../../types';
2
2
 
3
3
  export const cleanModelInfo = (card: IRawModelInfo): ICardInfo => ({
4
- title: card.title,
5
- description: card.description,
6
- social: card.social,
7
- orientation: card.orientation,
8
- videosCount: card.videos_count,
9
- thumbUrl: card.video_thumb_urls?.webp?.['480x270'],
10
- parameters: card.parameters,
4
+ title: card.title || '',
5
+ description: card.description || '',
6
+ social: card.social || '',
7
+ orientation: card.orientation || '',
8
+ videosCount: card.videos_count || 0,
9
+ thumbUrl: card.video_thumb_urls?.webp?.['480x270'] || '',
10
+ parameters: card.parameters || '',
11
11
  })
@@ -1,16 +1,16 @@
1
1
  import type { IRawPlaylistCard, IPlaylistCard } from '../../../types';
2
2
 
3
3
  export const cleanPlaylistCard = (card: IRawPlaylistCard): IPlaylistCard => ({
4
- created: card.created,
5
- id: card.id,
6
- name: card.name,
7
- username: card.username,
8
- playlistType: card.playlist_type,
9
- thumbUrls: card.thumbs?.map(item => item.urls.webp?.['480x270']),
10
- videosCount: card.videos_count,
11
- firstVideoId: card.first_video_id,
12
- searchTags: card.search_tags,
13
- views: card.views,
14
- likes: card.likes,
15
- dislikes: card.dislikes,
4
+ created: card.created || 0,
5
+ id: card.id || '',
6
+ name: card.name || '',
7
+ username: card.username || '',
8
+ playlistType: card.playlist_type || '',
9
+ thumbUrls: card.thumbs?.map(item => item.urls.webp?.['480x270'] || ''),
10
+ videosCount: card.videos_count || 0,
11
+ firstVideoId: card.first_video_id || '',
12
+ searchTags: card.search_tags || '',
13
+ views: card.views || 0,
14
+ likes: card.likes || 0,
15
+ dislikes: card.dislikes || 0,
16
16
  })
@@ -1,15 +1,15 @@
1
1
  import type { IRawPlaylistData, IPlaylistData } from '../../../types';
2
2
 
3
3
  export const cleanPlaylistData = (card: IRawPlaylistData): IPlaylistData => ({
4
- updated: card.updated,
5
- id: card.id,
6
- name: card.name,
7
- username: card.username,
8
- playlistType: card.playlist_type,
9
- videosCount: card.videos_count,
10
- firstVideoId: card.first_video_id,
11
- searchTags: card.search_tags,
12
- views: card.views,
13
- likes: card.likes,
14
- dislikes: card.dislikes,
4
+ updated: card.updated || 0,
5
+ id: card.id || '',
6
+ name: card.name || '',
7
+ username: card.username || '',
8
+ playlistType: card.playlist_type || '',
9
+ videosCount: card.videos_count || 0,
10
+ firstVideoId: card.first_video_id || '',
11
+ searchTags: card.search_tags || '',
12
+ views: card.views || 0,
13
+ likes: card.likes || 0,
14
+ dislikes: card.dislikes || 0,
15
15
  })
@@ -1,12 +1,12 @@
1
1
  import type { IRawPlaylistVideo, IVideoCard } from '../../../types';
2
2
 
3
3
  export const cleanPlaylistVideo = (card: IRawPlaylistVideo): IVideoCard => ({
4
- guid: card.guid,
5
- duration: card.duration,
6
- title: card.name,
7
- id: card.videoId,
8
- thumbUrl: card.thumb,
9
- playlistId: card.playlistId,
10
- md5: card.videoMd5,
11
- thumbNum: card.thumbNum,
4
+ guid: card.guid || '',
5
+ duration: card.duration || 0,
6
+ title: card.name || '',
7
+ id: card.videoId || '',
8
+ thumbUrl: card.thumb || '',
9
+ playlistId: card.playlistId || '',
10
+ md5: card.videoMd5 || '',
11
+ thumbNum: card.thumbNum || 0,
12
12
  })
@@ -1,11 +1,11 @@
1
1
  import type { IRawProfileData, IProfileData } from '../../../types';
2
2
 
3
3
  export const cleanProfileData = (data: IRawProfileData): IProfileData => ({
4
- username: data.username,
5
- email: data.email,
6
- avatar: data.avatar,
7
- country: data.country,
8
- city: data.city,
9
- birthday: data.birthday,
10
- gender: data.gender,
4
+ username: data.username || '',
5
+ email: data.email || '',
6
+ avatar: data.avatar || '',
7
+ country: data.country || '',
8
+ city: data.city || '',
9
+ birthday: data.birthday || 0,
10
+ gender: data.gender || '',
11
11
  })
@@ -1,11 +1,11 @@
1
1
  import type { IRawPlaylistsUser, IPlaylistCard } from '../../../types';
2
2
 
3
3
  export const cleanUserPlaylistCard = (card: IRawPlaylistsUser): IPlaylistCard => ({
4
- created: card.created,
5
- id: card.id,
6
- name: card.name,
7
- username: card.username,
8
- playlistType: card.playlistType,
9
- thumbUrls: card.thumbs.slice(0, 4),
10
- videosCount: card.videoCount,
4
+ created: card.created || 0,
5
+ id: card.id || '',
6
+ name: card.name || '',
7
+ username: card.username || '',
8
+ playlistType: card.playlistType || '',
9
+ thumbUrls: card.thumbs?.slice(0, 4) || [''],
10
+ videosCount: card.videoCount || 0,
11
11
  })
@@ -1,19 +1,19 @@
1
1
  import type { IRawVideoCard, IVideoCard } from '../../../types';
2
2
 
3
3
  export const cleanVideoCard = (card: IRawVideoCard): IVideoCard => ({
4
- guid: card.guid,
5
- quality: card.quality,
6
- duration: card.duration,
7
- title: card.title,
8
- views: card.views,
9
- id: card.id,
10
- tags: card.tags,
11
- isNew: card.is_new,
12
- channelAvatar: card.channel?.avatar_url,
13
- channelName: card.channel?.name,
14
- url: card.url,
15
- previewUrl: card.preview_url,
16
- thumbUrl: card.thumb_urls?.webp?.['480x270'],
17
- md5: card.md5,
18
- thumbNum: card.thumb_number,
4
+ guid: card.guid || '',
5
+ quality: card.quality || '',
6
+ duration: card.duration || 0,
7
+ title: card.title || '',
8
+ views: card.views || 0,
9
+ id: card.id || '',
10
+ tags: card.tags || '',
11
+ isNew: card.is_new || false,
12
+ channelAvatar: card.channel?.avatar_url || '',
13
+ channelName: card.channel?.name || '',
14
+ url: card.url || '',
15
+ previewUrl: card.preview_url || '',
16
+ thumbUrl: card.thumb_urls?.webp?.['480x270'] || '',
17
+ md5: card.md5 || '',
18
+ thumbNum: card.thumb_number || 0,
19
19
  })
@@ -22,6 +22,6 @@ export const cleanVideoData = (data: IRawVideoData): IVideoData => ({
22
22
  vttSpriteUrl: data.vtt_sprite_url || '',
23
23
  created: data.created || 0,
24
24
  videoUrl: data.video_url || '',
25
- isDeleted: data.is_deleted,
26
- thumbNum: data.thumb_number,
25
+ isDeleted: data.is_deleted || false,
26
+ thumbNum: data.thumb_number || 0,
27
27
  })