ChannelSerieCard.vue 2.01 KB
Newer Older
1
2
3
<template>
  <div class="channel-serie-card">
    <div class="two-images">
4
      <img alt="" @click="$router.push({name: 'library.albums.detail', params: {id: serie.id}})" class="channel-image" v-if="cover && cover.urls.original" v-lazy="$store.getters['instance/absoluteUrl'](cover.urls.medium_square_crop)">
5
      <img alt="" @click="$router.push({name: 'library.albums.detail', params: {id: serie.id}})" class="channel-image" v-else src="../../assets/audio/default-cover.png">
6
      <img alt="" @click="$router.push({name: 'library.albums.detail', params: {id: serie.id}})" class="channel-image" v-if="cover && cover.urls.original" v-lazy="$store.getters['instance/absoluteUrl'](cover.urls.medium_square_crop)">
7
      <img alt="" @click="$router.push({name: 'library.albums.detail', params: {id: serie.id}})" class="channel-image" v-else src="../../assets/audio/default-cover.png">
8
    </div>
Ciarán Ainsworth's avatar
Ciarán Ainsworth committed
9
    <div class="content ellipsis">
10
      <strong>
Ciarán Ainsworth's avatar
Ciarán Ainsworth committed
11
12
        <router-link class="discrete link" :to="{name: 'library.albums.detail', params: {id: serie.id}}">
          {{ serie.title }}
13
14
15
16
17
        </router-link>
      </strong>
      <div class="description">
        <translate translate-context="Content/Channel/Paragraph"
          translate-plural="%{ count } episodes"
18
19
          :translate-n="serie.tracks_count"
          :translate-params="{count: serie.tracks_count}">
20
21
22
23
24
          %{ count } episode
        </translate>
      </div>
    </div>
    <div class="controls">
Agate's avatar
Agate committed
25
      <play-button :icon-only="true" :is-playable="true" :button-classes="['ui', 'circular', 'vibrant', 'icon', 'button']" :album="serie"></play-button>
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    </div>
  </div>
</template>

<script>
import PlayButton from '@/components/audio/PlayButton'

export default {
  props: ['serie'],
  components: {
    PlayButton,
  },
  computed: {
    cover () {
      if (this.serie.cover) {
        return this.serie.cover
      }
    },
    duration () {
      let uploads = this.serie.uploads.filter((e) => {
        return e.duration
      })
      return uploads[0].duration
    }
  }
}
</script>