itube-specs 0.0.691 → 0.0.692

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.
@@ -26,7 +26,7 @@
26
26
 
27
27
  <script setup lang="ts">
28
28
  import type { IVideoCard } from '../../types';
29
- import { getDuration } from '../../runtime';
29
+ import { getDuration, ThumbSize } from '../../runtime';
30
30
 
31
31
  const props = defineProps<{
32
32
  card: IVideoCard
@@ -53,7 +53,7 @@ const posterPlaceholder = '/img/placeholder.webp'
53
53
 
54
54
  const currentPoster = computed(() => {
55
55
  if (posterError.value) return posterPlaceholder
56
- return props.card.thumbUrl || posterPlaceholder
56
+ return props.card.thumbUrls?.webp?.[ThumbSize.Small] || posterPlaceholder
57
57
  })
58
58
 
59
59
  function onPosterError() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.691",
4
+ "version": "0.0.692",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -5,7 +5,12 @@ export const cleanCategoryCard = (card: IRawCategoryCard): ICategoryCard => ({
5
5
  name: card.name || '',
6
6
  title: card.title || '',
7
7
  videosCount: card.videosCount || 0,
8
- thumbUrl: card.video_thumb_urls?.webp?.[ThumbSize.Medium] || '',
8
+ thumbUrls: card.video_thumb_urls ? {
9
+ webp: {
10
+ [ThumbSize.Small]: card.video_thumb_urls.webp?.[ThumbSize.Small] || '',
11
+ [ThumbSize.Medium]: card.video_thumb_urls.webp?.[ThumbSize.Medium] || '',
12
+ },
13
+ } : undefined,
9
14
  guid: card.guid || '',
10
15
  description: card.description || '',
11
16
  icon: card.icon || '',
@@ -9,6 +9,11 @@ export const cleanChannelCard = (card: IRawChannelCard): IChannelCard => ({
9
9
  isNetwork: card.is_network || false,
10
10
  updated: card.updated || 0,
11
11
  avatarUrl: card.avatar_url || '',
12
- thumbUrl: card.video_thumb_urls.webp?.[ThumbSize.Medium] || '',
12
+ thumbUrls: card.video_thumb_urls ? {
13
+ webp: {
14
+ [ThumbSize.Small]: card.video_thumb_urls.webp?.[ThumbSize.Small] || '',
15
+ [ThumbSize.Medium]: card.video_thumb_urls.webp?.[ThumbSize.Medium] || '',
16
+ },
17
+ } : undefined,
13
18
  description: card.description || '',
14
19
  })
@@ -7,7 +7,12 @@ export const cleanPlaylistCard = (card: IRawPlaylistCard): IPlaylistCard => ({
7
7
  name: card.name || '',
8
8
  username: card.username || '',
9
9
  playlistType: card.playlist_type || '',
10
- thumbUrls: card.thumbs?.map(item => item.urls.webp?.[ThumbSize.Small] || ''),
10
+ thumbUrls: card.thumbs?.map(item => ({
11
+ webp: {
12
+ [ThumbSize.Small]: item.urls.webp?.[ThumbSize.Small] || '',
13
+ [ThumbSize.Medium]: item.urls.webp?.[ThumbSize.Medium] || '',
14
+ },
15
+ })),
11
16
  videosCount: card.videos_count || 0,
12
17
  firstVideoId: card.first_video_id || '',
13
18
  searchTags: card.search_tags || '',
@@ -6,6 +6,11 @@ export const cleanPlaylistVideo = (card: IRawPlaylistVideo): IVideoCard => ({
6
6
  duration: card.duration || 0,
7
7
  title: card.title || '',
8
8
  id: card.id || '',
9
- thumbUrl: card.thumb_urls.webp?.[ThumbSize.Small] || '',
9
+ thumbUrls: card.thumb_urls ? {
10
+ webp: {
11
+ [ThumbSize.Small]: card.thumb_urls.webp?.[ThumbSize.Small] || '',
12
+ [ThumbSize.Medium]: card.thumb_urls.webp?.[ThumbSize.Medium] || '',
13
+ },
14
+ } : undefined,
10
15
  md5: card.md5 || '',
11
16
  })
@@ -1,8 +1,10 @@
1
+ import type { IThumbUrls } from './thumbs-urls';
2
+
1
3
  export interface ICategoryCard {
2
4
  name: string;
3
5
  title: string;
4
6
  videosCount: number;
5
- thumbUrl?: string;
7
+ thumbUrls?: IThumbUrls;
6
8
  guid: string;
7
9
  isTop?: boolean,
8
10
  icon?: string;
@@ -1,3 +1,5 @@
1
+ import type { IThumbUrls } from './thumbs-urls';
2
+
1
3
  export interface IChannelCard {
2
4
  guid: string;
3
5
  name: string;
@@ -6,6 +8,6 @@ export interface IChannelCard {
6
8
  isNetwork: boolean;
7
9
  updated: number;
8
10
  avatarUrl: string;
9
- thumbUrl: string;
11
+ thumbUrls?: IThumbUrls;
10
12
  description: string;
11
13
  }
@@ -1,4 +1,5 @@
1
1
  import type { EPlaylistType } from '../runtime/enums/playlist-type';
2
+ import type { IThumbUrls } from './thumbs-urls';
2
3
 
3
4
  export interface IPlaylistCard {
4
5
  created: number;
@@ -6,7 +7,7 @@ export interface IPlaylistCard {
6
7
  name: string;
7
8
  username: string;
8
9
  playlistType: EPlaylistType;
9
- thumbUrls: string[];
10
+ thumbUrls: IThumbUrls[];
10
11
  videosCount: number;
11
12
  firstVideoId?: string;
12
13
  searchTags?: string[];