itube-specs 0.0.321 → 0.0.322

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.
@@ -9,10 +9,11 @@
9
9
  <SImg
10
10
  class="s-video-mini-card__img"
11
11
  sizes="96px"
12
- :src="card.thumbUrl"
12
+ :src="currentPoster"
13
13
  width="96"
14
14
  height="64"
15
15
  :alt="card.title"
16
+ @error="onPosterError"
16
17
  />
17
18
  <SLabel
18
19
  class="s-video-mini-card__duration"
@@ -34,6 +35,8 @@ const props = defineProps<{
34
35
  prefix?: string
35
36
  }>()
36
37
 
38
+ const posterError = ref(false)
39
+
37
40
  const duration = computed(() => {
38
41
  return getDuration(props.card.duration)
39
42
  })
@@ -46,4 +49,15 @@ const component = computed(() => {
46
49
  })
47
50
 
48
51
  const { generateLink } = useGenerateLink();
52
+
53
+ const posterPlaceholder = '/img/placeholder.webp'
54
+
55
+ const currentPoster = computed(() => {
56
+ if (posterError.value) return posterPlaceholder
57
+ return props.card.thumbUrl || posterPlaceholder
58
+ })
59
+
60
+ function onPosterError() {
61
+ posterError.value = true
62
+ }
49
63
  </script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.321",
4
+ "version": "0.0.322",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -49,4 +49,6 @@ export enum EAsyncData {
49
49
  SetPlaylistView = 'set-playlist-view',
50
50
  PopularTagsByModel = 'popular-tags-by-model',
51
51
  ChannelsByModel = 'channels-by-model',
52
+ VideosByModelAndChannel = 'videos-by-model-and-channel',
53
+ VideosByModelAndTag = 'videos-by-model-and-tag',
52
54
  }