Commit d0398fa6 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt
Browse files

add cover image to recording previews

parent c390a069
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  <app-card :title="recording.title" :description="recording.description"
            :link="{ to: { name: 'recording', params: { id: recording.id } } }" has-body-link>
    <template v-slot:image>
      <app-play-pause :tracks="tracks" :track-id="recording.id" :title="recording.title"/>
      <app-play-pause :tracks="tracks" :track-id="recording.id" :title="recording.title" :image="coverImage"/>
    </template>

    <template v-slot:footer>
@@ -26,6 +26,11 @@
      recording: Object
    },
    computed: {
      coverImage () {
        return this.recording.cover_image
          ? this.dataSources.createImageUrl(this.recording.cover_image)
          : null
      },
      productionDate () {
        return new Date(this.recording.production_date)
      },
@@ -35,7 +40,8 @@
      durationLabel () {
        return secondsToDuration(this.duration)
      }
    }
    },
    inject: ['dataSources']
  }
</script>