Disabled eager searching except for entities. Updating movie search document on store.
This commit is contained in:
parent
85c6b581cb
commit
bb384029ac
|
@ -1,7 +1,10 @@
|
|||
<template>
|
||||
<div class="networks">
|
||||
<div class="content-inner">
|
||||
<SearchBar :placeholder="`Search ${channelCount} channels in ${entities.length} networks`" />
|
||||
<SearchBar
|
||||
:placeholder="`Search ${channelCount} channels in ${entities.length} networks`"
|
||||
:eager="true"
|
||||
/>
|
||||
|
||||
<span
|
||||
v-if="done && entities.length === 0"
|
||||
|
@ -14,7 +17,7 @@
|
|||
>
|
||||
<Entity
|
||||
v-for="entity in entities"
|
||||
:key="`entity-tile-${entity.slug}`"
|
||||
:key="entity.parent ? `entity-tile-${entity.parent.slug}-${entity.slug}` : `entity-tile-${entity.slug}`"
|
||||
:entity="entity"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<form
|
||||
class="search"
|
||||
@submit.prevent="search"
|
||||
@submit.prevent="() => search()"
|
||||
>
|
||||
<input
|
||||
v-model="query"
|
||||
:placeholder="placeholder || 'Search'"
|
||||
class="query"
|
||||
@input="search"
|
||||
@input="() => search(true)"
|
||||
>
|
||||
|
||||
<button
|
||||
|
@ -18,8 +18,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
function search() {
|
||||
this.$router.replace({ query: { query: this.query || undefined } });
|
||||
function search(typing) {
|
||||
if (!typing || this.eager) {
|
||||
this.$router.replace({ query: { query: this.query || undefined } });
|
||||
}
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
|
@ -32,6 +34,10 @@ export default {
|
|||
type: String,
|
||||
default: null,
|
||||
},
|
||||
eager: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -450,6 +450,7 @@ async function storeMovies(movies) {
|
|||
const storedMovies = await bulkInsert('movies', curatedMovieEntries, ['entity_id', 'entry_id'], true);
|
||||
const moviesWithId = attachReleaseIds(movies, storedMovies);
|
||||
|
||||
await updateMovieSearch(moviesWithId.map(movie => movie.id));
|
||||
await associateReleaseMedia(moviesWithId, 'movie');
|
||||
|
||||
return moviesWithId;
|
||||
|
|
Loading…
Reference in New Issue