Using summaries table for improved performance.

This commit is contained in:
DebaucheryLibrarian
2023-07-17 01:59:26 +02:00
parent 2783de5272
commit 2b3b2d7fd2
191 changed files with 198 additions and 80 deletions

View File

@@ -28,7 +28,12 @@
</template>
<span
v-if="!loading && actors.length === 0 && releases.length === 0"
v-if="error"
class="error summary"
>{{ error }}</span>
<span
v-else-if="!loading && actors.length === 0 && releases.length === 0"
class="summary"
>No results</span>
</div>
@@ -39,16 +44,23 @@ import Actor from '../actors/tile.vue';
import Releases from '../releases/releases.vue';
async function search() {
const results = await this.$store.dispatch('search', {
query: this.query,
limit: 10,
});
try {
const results = await this.$store.dispatch('search', {
query: this.query,
limit: 10,
});
this.loading = false;
this.loading = false;
if (results) {
this.actors = results.actors;
this.releases = results.releases;
if (results) {
this.actors = results.actors;
this.releases = results.releases;
}
} catch (error) {
this.loading = false;
this.error = 'Failed to retrieve search results, sorry about that.';
console.error(error);
}
}
@@ -101,6 +113,10 @@ export default {
margin: 0 0 1rem 0;
color: var(--shadow);
font-weight: bold;
&.error {
color: var(--error);
}
}
.tiles {