When poster is not available during scraping, first photo is stored as poster; removed client-side fallback. Added screencap album fallback to Jules Jordan scraper. Simplified JJ page traversal.

This commit is contained in:
2019-12-13 16:59:04 +01:00
parent 5b5d383363
commit fed2b0be8a
6 changed files with 58 additions and 69 deletions

View File

@@ -22,7 +22,7 @@
<video
v-if="release.trailer"
:src="`/media/${release.trailer.path}`"
:poster="`/media/${(release.poster && release.poster.thumbnail) || (release.photos.length && release.photos[Math.floor(Math.random() * release.photos.length)].path)}`"
:poster="`/media/${(release.poster && release.poster.thumbnail)}`"
:alt="release.title"
class="item trailer-video"
controls
@@ -47,21 +47,16 @@
<script>
function photos() {
if (this.release.photos.length) {
const set = this.release.photos.sort(({ index: indexA }, { index: indexB }) => indexA - indexB);
if (this.release.trailer) {
return set;
}
return [this.release.poster].concat(set);
if (this.release.trailer) {
// poster will be on trailer video
return this.release.photos;
}
if (this.release.poster && !this.release.trailer) {
return [this.release.poster];
if (this.release.poster) {
return [this.release.poster].concat(this.release.photos);
}
return [];
return this.release.photos;
}
function scrollBanner(event) {