Added box cover filter to movies.
This commit is contained in:
parent
7b78724bb4
commit
ddaf5c3b42
|
@ -37,6 +37,14 @@
|
|||
:actors="aggActors"
|
||||
@update="updateFilter"
|
||||
/>
|
||||
|
||||
<div class="filter">
|
||||
<Checkbox
|
||||
:checked="filters.requireCover"
|
||||
label="Require box cover"
|
||||
@change="(checked) => updateFilter('requireCover', checked, true)"
|
||||
/>
|
||||
</div>
|
||||
</Filters>
|
||||
|
||||
<div class="movies-container">
|
||||
|
@ -100,6 +108,7 @@ import YearsFilter from '#/components/filters/years.vue';
|
|||
import ActorsFilter from '#/components/filters/actors.vue';
|
||||
import TagsFilter from '#/components/filters/tags.vue';
|
||||
import ChannelsFilter from '#/components/filters/channels.vue';
|
||||
import Checkbox from '#/components/form/checkbox.vue';
|
||||
import Pagination from '#/components/pagination/pagination.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
@ -139,6 +148,7 @@ const filters = ref({
|
|||
tags: urlParsed.search.tags?.split(',').filter(Boolean) || [],
|
||||
entity: queryEntity,
|
||||
actors: queryActors,
|
||||
requireCover: !!urlParsed.search.cover,
|
||||
});
|
||||
|
||||
function getPath(targetScope, preserveQuery) {
|
||||
|
@ -178,6 +188,7 @@ async function search(options = {}) {
|
|||
|
||||
const query = {
|
||||
q: filters.value.search || undefined,
|
||||
cover: filters.value.requireCover || undefined,
|
||||
};
|
||||
|
||||
const entity = filters.value.entity || pageEntity;
|
||||
|
|
|
@ -287,6 +287,10 @@ async function queryManticoreSql(filters, options) {
|
|||
builder.whereRaw('any(entity_ids) = ?', filters.entityId);
|
||||
}
|
||||
|
||||
if (filters.requireCover) {
|
||||
builder.where('has_cover', true);
|
||||
}
|
||||
|
||||
if (typeof filters.isShowcased === 'boolean') {
|
||||
builder.where('is_showcased', filters.isShowcased);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue