Use the new datetime field in the video object if possible

This commit is contained in:
root
2022-02-06 23:20:45 +05:30
parent 211e5eb5ad
commit 3eff080189
+30 -18
View File
@@ -1,32 +1,44 @@
<template>
<v-card link :to="video.url" outlined :height="maxHeight ? '100%' : undefined" color="bgTwo">
<v-img
:height="height"
:width="width"
:src="video.thumbnail || video.thumbnailUrl"
alt="thumbnail"
loading="lazy"
/>
<v-progress-linear :value="progress" v-if="alreadyWatched" />
<v-card-title class="text-subtitle-1">{{ video.title }}</v-card-title>
<v-card-text>
<router-link :to="video.uploaderUrl" class="text-subtitle-1 text-decoration-none" v-if="video.uploaderUrl && (video.uploaderName || video.uploader) && !hideChannel" custom v-slot="{ navigate }">
<h5 @click="navigate" @keypress.enter="navigate" role="link">{{ video.uploaderName || video.uploader }}</h5>
</router-link>
<slot />
{{ $tc('counts.views', video.views, { n: this.$store.getters['i18n/fmtNumber'](video.views) }) }}<br />
{{ video.uploadedDate }} <br />
{{ timeFormat(video.duration) }}
</v-card-text>
<v-img
:height="height"
:width="width"
:src="video.thumbnail || video.thumbnailUrl"
alt="thumbnail"
loading="lazy"
/>
<v-progress-linear :value="progress" v-if="alreadyWatched" />
<v-card-title class="text-subtitle-1">{{ video.title }}</v-card-title>
<v-card-text>
<router-link
:to="video.uploaderUrl" class="text-subtitle-1 text-decoration-none"
v-if="video.uploaderUrl && (video.uploaderName || video.uploader) && !hideChannel" custom
v-slot="{ navigate }"
>
<h5 @click="navigate" @keypress.enter="navigate" role="link">{{ video.uploaderName || video.uploader }}</h5>
</router-link>
<slot />
{{ $tc('counts.views', video.views, { n: this.$store.getters['i18n/fmtNumber'](video.views) }) }}<br />
<span v-if="video.uploaded > 0">
<ExpandableDate :date="new Date(video.uploaded)" />
</span>
<span v-else-if="video.uploadedDate">
{{ video.uploadedDate }}
</span>
<br />
{{ timeFormat(video.duration) }}
</v-card-text>
</v-card>
</template>
<script>
import { LibPiped } from '@/tools/libpiped'
import { findLastWatch } from '@/store/watched-videos-db'
import ExpandableDate from '@/components/ExpandableDate'
export default {
name: 'VideoItem',
components: { ExpandableDate },
props: {
video: Object,
height: Number,