Replaced batch ranges with 'New' sorting.

This commit is contained in:
ThePendulum 2020-04-16 22:23:25 +02:00
parent e3dfaf4440
commit 3b2bf921f3
16 changed files with 126 additions and 44 deletions

View File

@ -1,6 +1,8 @@
<template> <template>
<div class="filter-bar noselect"> <div class="filter-bar noselect">
<span> <span class="sort">
<Icon icon="sort-time-asc" />
<label class="range"> <label class="range">
<input <input
:id="`${_uid}-range-latest`" :id="`${_uid}-range-latest`"
@ -29,6 +31,20 @@
>Upcoming</label> >Upcoming</label>
</label> </label>
<label class="range">
<input
:id="`${_uid}-range-new`"
:checked="range === 'new'"
type="radio"
class="range-input"
@click="setRange('new')"
>
<label
:for="`${_uid}-range-new`"
class="range-button"
>New</label>
</label>
<label class="range"> <label class="range">
<input <input
:id="`${_uid}-range-all`" :id="`${_uid}-range-all`"
@ -44,39 +60,6 @@
</label> </label>
</span> </span>
<span>
<label class="batch">
<input
:id="`${_uid}-batch-all`"
:checked="batch === 'all'"
type="radio"
class="range-input"
@click="setBatch('all')"
>
<label
:for="`${_uid}-batch-all`"
class="range-button"
>All</label>
</label>
<label
v-tooltip="'Only show newly added'"
class="batch"
>
<input
:id="`${_uid}-batch-new`"
:checked="batch === 'new'"
type="radio"
class="range-input"
@click="setBatch('new')"
>
<label
:for="`${_uid}-batch-new`"
class="range-button"
>New</label>
</label>
</span>
<span> <span>
<span class="filters-container"> <span class="filters-container">
<Icon icon="filter" /> <Icon icon="filter" />
@ -177,10 +160,16 @@ export default {
box-shadow: 0 0 3px var(--darken); box-shadow: 0 0 3px var(--darken);
.icon { .icon {
margin: 0 .5rem 0 0;
fill: var(--shadow); fill: var(--shadow);
} }
} }
.sort {
display: flex;
align-items: center;
}
.filters-container { .filters-container {
display: inline-block; display: inline-block;
} }

14
assets/img/move-down.svg Normal file
View File

@ -0,0 +1,14 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>move-down</title>
<path d="M12 11v-6h-1v6h-2.5l3 3 3-3z"></path>
<path d="M5 4v3h-3v-3h3zM6 3h-5v5h5v-5z"></path>
<path d="M1 10h1.5v1h-1.5v-1z"></path>
<path d="M3 10h1.5v1h-1.5v-1z"></path>
<path d="M5 10h1v1.5h-1v-1.5z"></path>
<path d="M1 13.5h1v1.5h-1v-1.5z"></path>
<path d="M2.5 14h1.5v1h-1.5v-1z"></path>
<path d="M4.5 14h1.5v1h-1.5v-1z"></path>
<path d="M1 11.5h1v1.5h-1v-1.5z"></path>
<path d="M5 12h1v1.5h-1v-1.5z"></path>
</svg>

After

Width:  |  Height:  |  Size: 579 B

14
assets/img/move-up.svg Normal file
View File

@ -0,0 +1,14 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>move-up</title>
<path d="M11 8v6h1v-6h2.5l-3-3-3 3z"></path>
<path d="M1 3h1.5v1h-1.5v-1z"></path>
<path d="M3 3h1.5v1h-1.5v-1z"></path>
<path d="M5 3h1v1.5h-1v-1.5z"></path>
<path d="M1 6.5h1v1.5h-1v-1.5z"></path>
<path d="M2.5 7h1.5v1h-1.5v-1z"></path>
<path d="M4.5 7h1.5v1h-1.5v-1z"></path>
<path d="M1 4.5h1v1.5h-1v-1.5z"></path>
<path d="M5 5h1v1.5h-1v-1.5z"></path>
<path d="M5 11v3h-3v-3h3zM6 10h-5v5h5v-5z"></path>
</svg>

After

Width:  |  Height:  |  Size: 569 B

View File

@ -0,0 +1,7 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-alpha-asc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M14.5 16h-4c-0.184 0-0.354-0.101-0.441-0.264s-0.077-0.36 0.025-0.513l3.482-5.223h-3.066c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h4c0.184 0 0.354 0.101 0.441 0.264s0.077 0.36-0.025 0.513l-3.482 5.223h3.066c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"></path>
<path d="M15.947 6.276l-3-6c-0.085-0.169-0.258-0.276-0.447-0.276s-0.363 0.107-0.447 0.276l-3 6c-0.123 0.247-0.023 0.547 0.224 0.671 0.072 0.036 0.148 0.053 0.223 0.053 0.183 0 0.36-0.101 0.448-0.277l0.862-1.724h3.382l0.862 1.724c0.123 0.247 0.424 0.347 0.671 0.224s0.347-0.424 0.224-0.671zM11.309 4l1.191-2.382 1.191 2.382h-2.382z"></path>
</svg>

After

Width:  |  Height:  |  Size: 842 B

View File

@ -0,0 +1,7 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-alpha-desc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M14.5 7h-4c-0.184 0-0.354-0.101-0.441-0.264s-0.077-0.36 0.025-0.513l3.482-5.223h-3.066c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h4c0.184 0 0.354 0.102 0.441 0.264s0.077 0.36-0.025 0.513l-3.482 5.223h3.066c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"></path>
<path d="M15.947 15.276l-3-6c-0.085-0.169-0.258-0.276-0.447-0.276s-0.363 0.107-0.447 0.276l-3 6c-0.123 0.247-0.023 0.547 0.224 0.671 0.072 0.036 0.148 0.053 0.223 0.053 0.183 0 0.36-0.101 0.448-0.277l0.862-1.724h3.382l0.862 1.724c0.123 0.247 0.424 0.347 0.671 0.224s0.347-0.424 0.224-0.671zM11.309 13l1.191-2.382 1.191 2.382h-2.382z"></path>
</svg>

After

Width:  |  Height:  |  Size: 844 B

View File

@ -0,0 +1,9 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-amount-asc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M7 9h9v2h-9v-2z"></path>
<path d="M7 6h7v2h-7v-2z"></path>
<path d="M7 3h5v2h-5v-2z"></path>
<path d="M7 0h3v2h-3v-2z"></path>
</svg>

After

Width:  |  Height:  |  Size: 366 B

View File

@ -0,0 +1,9 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-amount-desc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M7 0h9v2h-9v-2z"></path>
<path d="M7 3h7v2h-7v-2z"></path>
<path d="M7 6h5v2h-5v-2z"></path>
<path d="M7 9h3v2h-3v-2z"></path>
</svg>

After

Width:  |  Height:  |  Size: 367 B

View File

@ -0,0 +1,7 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-numberic-desc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M13.5 16c-0.276 0-0.5-0.224-0.5-0.5v-5.5h-0.5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h1c0.276 0 0.5 0.224 0.5 0.5v6c0 0.276-0.224 0.5-0.5 0.5z"></path>
<path d="M14.5 0h-3c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h2.5v2h-2.5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-6c0-0.276-0.224-0.5-0.5-0.5zM12 1h2v2h-2v-2z"></path>
</svg>

After

Width:  |  Height:  |  Size: 613 B

View File

@ -0,0 +1,7 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-numeric-asc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M13.5 7c-0.276 0-0.5-0.224-0.5-0.5v-5.5h-0.5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h1c0.276 0 0.5 0.224 0.5 0.5v6c0 0.276-0.224 0.5-0.5 0.5z"></path>
<path d="M14.5 9h-3c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h2.5v2h-2.5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-6c0-0.276-0.224-0.5-0.5-0.5zM12 10h2v2h-2v-2z"></path>
</svg>

After

Width:  |  Height:  |  Size: 611 B

View File

@ -0,0 +1,7 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-time-asc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M10.5 2c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h2c0.276 0 0.5-0.224 0.5-0.5s-0.224-0.5-0.5-0.5h-1.5v-2.5c0-0.276-0.224-0.5-0.5-0.5z"></path>
<path d="M16 5c0-2.757-2.243-5-5-5s-5 2.243-5 5v0.5c0 0.276 0.224 0.5 0.5 0.5s0.5-0.224 0.5-0.5v-0.5c0-2.206 1.794-4 4-4s4 1.794 4 4c0 1.86-1.277 3.428-3 3.873v-1.873l-3 2.5 3 2.5v-2.101c2.28-0.465 4-2.485 4-4.899z"></path>
</svg>

After

Width:  |  Height:  |  Size: 617 B

View File

@ -0,0 +1,7 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>sort-time-desc</title>
<path d="M5 12v-12h-2v12h-2.5l3.5 3.5 3.5-3.5h-2.5z"></path>
<path d="M10.5 2c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h2c0.276 0 0.5-0.224 0.5-0.5s-0.224-0.5-0.5-0.5h-1.5v-2.5c0-0.276-0.224-0.5-0.5-0.5z"></path>
<path d="M6 5c0-2.757 2.243-5 5-5s5 2.243 5 5v0.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5v-0.5c0-2.206-1.794-4-4-4s-4 1.794-4 4c0 1.86 1.277 3.428 3 3.873v-1.873l3 2.5-3 2.5v-2.101c-2.279-0.465-4-2.485-4-4.899z"></path>
</svg>

After

Width:  |  Height:  |  Size: 619 B

View File

@ -184,9 +184,6 @@ const releasesFragment = `
} }
} }
} }
isNew: {
in: $isNew
}
}, },
first: $limit, first: $limit,
orderBy: $orderBy, orderBy: $orderBy,

View File

@ -9,7 +9,6 @@ function initReleasesActions(store, _router) {
$limit:Int = 1000, $limit:Int = 1000,
$after:Date = "1900-01-01", $after:Date = "1900-01-01",
$before:Date = "2100-01-01", $before:Date = "2100-01-01",
$isNew:[Boolean!] = [true,false]
$orderBy:[ReleasesOrderBy!], $orderBy:[ReleasesOrderBy!],
$exclude: [String!] $exclude: [String!]
) { ) {
@ -19,8 +18,7 @@ function initReleasesActions(store, _router) {
limit, limit,
after: store.getters.after, after: store.getters.after,
before: store.getters.before, before: store.getters.before,
isNew: store.getters.isNew, orderBy: store.getters.orderBy,
orderBy: store.state.ui.range === 'upcoming' ? 'DATE_ASC' : 'DATE_DESC',
exclude: store.state.ui.filter, exclude: store.state.ui.filter,
}); });

View File

@ -4,14 +4,22 @@ const dateRanges = {
latest: () => ({ latest: () => ({
after: '1900-01-01', after: '1900-01-01',
before: dayjs(new Date()).add(1, 'day').format('YYYY-MM-DD'), before: dayjs(new Date()).add(1, 'day').format('YYYY-MM-DD'),
orderBy: 'DATE_DESC',
}), }),
upcoming: () => ({ upcoming: () => ({
after: dayjs(new Date()).format('YYYY-MM-DD'), after: dayjs(new Date()).format('YYYY-MM-DD'),
before: '2100-01-01', before: '2100-01-01',
orderBy: 'DATE_ASC',
}),
new: () => ({
after: '1900-01-01',
before: '2100-01-01',
orderBy: 'CREATED_AT_DESC',
}), }),
all: () => ({ all: () => ({
after: '1900-01-01', after: '1900-01-01',
before: '2100-01-01', before: '2100-01-01',
orderBy: 'DATE_DESC',
}), }),
}; };
@ -27,13 +35,13 @@ function after(state) {
return dateRanges[state.range]().after; return dateRanges[state.range]().after;
} }
function isNew(state) { function orderBy(state) {
return state.batch === 'new' ? [true] : [true, false]; return dateRanges[state.range]().orderBy;
} }
export default { export default {
rangeDates, rangeDates,
before, before,
after, after,
isNew, orderBy,
}; };

View File

@ -88,7 +88,7 @@ const tags = [
{ {
name: 'anal', name: 'anal',
slug: 'anal', slug: 'anal',
description: 'Taking a cock in the asshole.', description: 'Getting fucked in the asshole.',
priority: 9, priority: 9,
group: 'penetration', group: 'penetration',
}, },

View File

@ -505,6 +505,7 @@ async function storeMedias(baseMedias) {
const savedMedias = await Promise.map( const savedMedias = await Promise.map(
baseMedias, baseMedias,
async baseMedia => fetchMedia(baseMedia, { existingSourceMediaByUrl, existingExtractMediaByUrl }), async baseMedia => fetchMedia(baseMedia, { existingSourceMediaByUrl, existingExtractMediaByUrl }),
{ concurrency: 10 },
); );
const [uniqueHashMedias, existingHashMedias] = await findHashDuplicates(savedMedias); const [uniqueHashMedias, existingHashMedias] = await findHashDuplicates(savedMedias);
@ -526,6 +527,7 @@ async function associateReleaseMedia(releases) {
...acc, ...acc,
[release.id]: [ [release.id]: [
...(argv.images && argv.poster ? toBaseMedias([release.poster], 'posters') : []), ...(argv.images && argv.poster ? toBaseMedias([release.poster], 'posters') : []),
...(argv.images && argv.poster ? toBaseMedias([release.poster], 'covers') : []),
...(argv.images && argv.photos ? toBaseMedias(release.photos, 'photos') : []), ...(argv.images && argv.photos ? toBaseMedias(release.photos, 'photos') : []),
...(argv.videos && argv.trailer ? toBaseMedias([release.trailer], 'trailers') : []), ...(argv.videos && argv.trailer ? toBaseMedias([release.trailer], 'trailers') : []),
...(argv.videos && argv.teaser ? toBaseMedias([release.teaser], 'teasers') : []), ...(argv.videos && argv.teaser ? toBaseMedias([release.teaser], 'teasers') : []),