forked from DebaucheryLibrarian/traxxx
Scene tile uses first photo if poster is unavailable.
This commit is contained in:
parent
998774fe5c
commit
73b28866ac
|
@ -26,20 +26,14 @@
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
>
|
>
|
||||||
|
|
||||||
<span
|
|
||||||
v-else-if="release.covers && release.covers.length > 0"
|
|
||||||
class="covers"
|
|
||||||
>
|
|
||||||
<img
|
<img
|
||||||
v-for="cover in release.covers"
|
v-else-if="release.photos && release.photos.length > 0"
|
||||||
:key="cover.id"
|
:src="sfw ? `/img/${release.photos[0].sfw.thumbnail}` : `/media/${release.photos[0].thumbnail}`"
|
||||||
:src="sfw ? `/img/${cover.sfw.thumbnail}` : `/media/${cover.thumbnail}`"
|
:style="{ 'background-image': sfw ? `/img/${release.photos[0].sfw.lazy}` : `/media/${release.photos[0].lazy}` }"
|
||||||
:style="{ 'background-image': sfw ? `/img/${cover.sfw.lazy}` : `/media/${cover.lazy}` }"
|
|
||||||
:alt="release.title"
|
:alt="release.title"
|
||||||
class="thumbnail cover"
|
class="thumbnail"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
>
|
>
|
||||||
</span>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
|
|
|
@ -193,6 +193,7 @@ const releaseFields = `
|
||||||
${releaseTagsFragment}
|
${releaseTagsFragment}
|
||||||
${releasePosterFragment}
|
${releasePosterFragment}
|
||||||
${releaseCoversFragment}
|
${releaseCoversFragment}
|
||||||
|
${releasePhotosFragment}
|
||||||
${siteFragment}
|
${siteFragment}
|
||||||
studio {
|
studio {
|
||||||
id
|
id
|
||||||
|
|
|
@ -240,14 +240,21 @@ async function fetchLatest(entity, page, options) {
|
||||||
release.photos = Array.from({ length: Math.floor(Math.random() * 10) + 1 }, () => `${options.source}?id=${nanoid()}`); // ensure source is unique
|
release.photos = Array.from({ length: Math.floor(Math.random() * 10) + 1 }, () => `${options.source}?id=${nanoid()}`); // ensure source is unique
|
||||||
} else {
|
} else {
|
||||||
// select from local SFW database
|
// select from local SFW database
|
||||||
const [poster, ...photos] = await knex('media')
|
const [/* poster */, ...photos] = await knex('media')
|
||||||
.select('path')
|
.select('path')
|
||||||
.where('is_sfw', true)
|
.where('is_sfw', true)
|
||||||
.pluck('path')
|
.pluck('path')
|
||||||
.orderByRaw('random()')
|
.orderByRaw('random()')
|
||||||
.limit(Math.floor(Math.random() * 10) + 1);
|
.limit(Math.floor(Math.random() * 10) + 1);
|
||||||
|
|
||||||
release.poster = `http://${config.web.host}:${config.web.port}/img/${poster}?id=${nanoid()}`; // ensure source is unique
|
const [poster] = await knex('media')
|
||||||
|
.select('path')
|
||||||
|
.where('is_sfw', true)
|
||||||
|
.pluck('path')
|
||||||
|
.limit(1);
|
||||||
|
|
||||||
|
// release.poster = `http://${config.web.host}:${config.web.port}/img/${poster}?id=${nanoid()}`; // ensure source is unique
|
||||||
|
release.poster = `http://${config.web.host}:${config.web.port}/img/${poster}`; // ensure source is unique
|
||||||
release.photos = photos.map(photo => `http://${config.web.host}:${config.web.port}/img/${photo}?id=${nanoid()}`);
|
release.photos = photos.map(photo => `http://${config.web.host}:${config.web.port}/img/${photo}?id=${nanoid()}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -356,6 +356,8 @@ async function associateMovieScenes(movies, movieScenes) {
|
||||||
return null;
|
return null;
|
||||||
}).filter(Boolean);
|
}).filter(Boolean);
|
||||||
|
|
||||||
|
console.log(movies, movieScenes, associations);
|
||||||
|
|
||||||
await bulkInsert('movies_scenes', associations, false);
|
await bulkInsert('movies_scenes', associations, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue