diff --git a/components/scenes/tile.vue b/components/scenes/tile.vue index f0c0a6f..9a360b4 100644 --- a/components/scenes/tile.vue +++ b/components/scenes/tile.vue @@ -63,13 +63,14 @@ {{ format(scene.effectiveDate, 'MMM d, y') }} @@ -249,6 +250,11 @@ const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.id === align-items: center; } +.nodate { + font-style: italic; + color: var(--highlight); +} + .row { margin: 0 .5rem .25rem .5rem; font-size: .9rem; diff --git a/pages/scene/+Page.vue b/pages/scene/+Page.vue index 88e6cee..3922eb1 100644 --- a/pages/scene/+Page.vue +++ b/pages/scene/+Page.vue @@ -93,8 +93,10 @@ - - Duration - {{ formatDuration(scene.duration) }} - - director.name).join(', ') }} + + Duration + {{ formatDuration(scene.duration) }} + + Shoot {{ scene.shootId }} + + + Quality + {{ scene.qualities.map((quality) => `${quality}p`).join(', ') }} + @@ -533,6 +543,11 @@ function copySummary() { font-weight: bold; } +.nodate { + color: var(--highlight); + font-weight: normal; +} + .info, .header { border-top: none; @@ -647,7 +662,7 @@ function copySummary() { .details { display: flex; - gap: 1rem; + gap: 1rem 1.5rem; } .description { diff --git a/src/scenes.js b/src/scenes.js index 0e9a7c6..e2efe12 100644 --- a/src/scenes.js +++ b/src/scenes.js @@ -74,6 +74,7 @@ function curateScene(rawScene, assets) { slug: tag.slug, name: tag.name, })), + qualities: rawScene.qualities.sort((qualityA, qualityB) => qualityB - qualityA), movies: assets.movies.map((movie) => ({ id: movie.id, slug: movie.slug, @@ -263,160 +264,6 @@ function curateOptions(options) { }; } -/* -function buildQuery(filters = {}, options) { - const query = { - bool: { - must: [], - }, - }; - - let sort = [{ effective_date: 'desc' }]; - - if (!filters.scope || filters.scope === 'latest') { - query.bool.must.push({ - range: { - effective_date: { - lte: Math.round(Date.now() / 1000), - }, - }, - }); - } - - if (filters.scope === 'upcoming') { - query.bool.must.push({ - range: { - effective_date: { - gt: Math.round(Date.now() / 1000), - }, - }, - }); - - sort = [{ effective_date: 'asc' }]; - } - - if (filters.scope === 'new') { - sort = [{ created_at: 'desc' }, { effective_date: 'asc' }]; - } - - if (filters.scope === 'likes') { - sort = [{ stashed: 'desc' }, { effective_date: 'desc' }]; - } - - if (filters.scope === 'results') { - sort = [{ _score: 'desc' }, { effective_date: 'desc' }]; - } - - if (filters.query) { - query.bool.must.push({ match: { '!title': filters.query } }); // title_filtered is matched instead of title - } - - if (filters.tagIds) { - filters.tagIds.forEach((tagId) => { - query.bool.must.push({ equals: { 'any(tag_ids)': tagId } }); - }); - } - - if (filters.entityId) { - query.bool.must.push({ - bool: { - should: [ - { equals: { channel_id: filters.entityId } }, - { equals: { network_id: filters.entityId } }, - ], - }, - }); - } - - if (filters.actorIds) { - filters.actorIds.forEach((actorId) => { - query.bool.must.push({ equals: { 'any(actor_ids)': actorId } }); - }); - } - - if (filters.stashId && options.index === 'scenes_stashed') { - query.bool.must.push({ equals: { stash_id: filters.stashId } }); - } - - return { query, sort }; -} - -function buildAggregates(options) { - const aggregates = {}; - - if (options.aggregateActors) { - aggregates.actorIds = { - terms: { - field: 'actor_ids', - size: config.database.manticore.maxAggregateSize, - }, - sort: [{ 'count(*)': { order: 'desc' } }], - }; - } - - if (options.aggregateTags) { - aggregates.tagIds = { - terms: { - field: 'tag_ids', - size: config.database.manticore.maxAggregateSize, - }, - sort: [{ 'count(*)': { order: 'desc' } }], - }; - } - - if (options.aggregateChannels) { - aggregates.channelIds = { - terms: { - field: 'channel_id', - size: config.database.manticore.maxAggregateSize, - }, - sort: [{ 'count(*)': { order: 'desc' } }], - }; - } - - return aggregates; -} - -async function queryManticoreJson(filters, options, _reqUser) { - const { query, sort } = buildQuery(filters, options); - - const result = await searchApi.search({ - index: options.index, - query, - limit: options.limit, - offset: (options.page - 1) * options.limit, - sort, - aggs: buildAggregates(options), - options: { - max_matches: config.database.manticore.maxMatches, - max_query_time: config.database.manticore.maxQueryTime, - field_weights: { - title_filtered: 7, - actors: 10, - tags: 9, - meta: 6, - channel_name: 2, - channel_slug: 3, - network_name: 1, - network_slug: 1, - }, - }, - }); - - const scenes = result.hits.hits.map((hit) => ({ - id: hit._id, - ...hit._source, - _score: hit._score, - })); - - return { - scenes, - total: result.hits.total, - aggregations: result.aggregations && Object.fromEntries(Object.entries(result.aggregations).map(([key, { buckets }]) => [key, buckets])), - }; -} -*/ - async function queryManticoreSql(filters, options, _reqUser) { const aggSize = config.database.manticore.maxAggregateSize; @@ -613,12 +460,6 @@ export async function fetchScenes(filters, rawOptions, reqUser) { console.log('filters', filters); console.log('options', options); - /* - const result = config.database.manticore.forceSql || filters.stashId - ? await queryManticoreSql(filters, options, reqUser) - : await queryManticoreJson(filters, options, reqUser); - */ - console.time('manticore sql'); const result = await queryManticoreSql(filters, options, reqUser); console.timeEnd('manticore sql');