[web] Rename indexList to indices

This commit is contained in:
Alain Nussbaumer 2024-02-27 16:27:37 +01:00
parent 062a98b2a8
commit c94b905d72
14 changed files with 24 additions and 24 deletions

View File

@ -2,11 +2,11 @@
<section> <section>
<nav class="buttons is-centered mb-4 fd-is-square"> <nav class="buttons is-centered mb-4 fd-is-square">
<router-link <router-link
v-for="id in index" v-for="index in indices"
:key="id" :key="index"
class="button is-small" class="button is-small"
:to="'#index_' + id" :to="'#index_' + index"
>{{ id }}</router-link >{{ index }}</router-link
> >
</nav> </nav>
</section> </section>
@ -15,7 +15,7 @@
<script> <script>
export default { export default {
name: 'IndexButtonList', name: 'IndexButtonList',
props: ['index'] props: { indices: Array }
} }
</script> </script>

View File

@ -115,7 +115,7 @@ export class GroupedList {
this.offset = offset this.offset = offset
this.limit = limit this.limit = limit
this.count = items.length this.count = items.length
this.indexList = [] this.indices = []
this.group(noop()) this.group(noop())
} }
@ -135,7 +135,7 @@ export class GroupedList {
: itemsFiltered : itemsFiltered
// Create index list // Create index list
this.indexList = [...new Set(itemsSorted.map(options.groupKeyFn))] this.indices = [...new Set(itemsSorted.map(options.groupKeyFn))]
// Group item list // Group item list
this.itemsGrouped = itemsSorted.reduce((r, item) => { this.itemsGrouped = itemsSorted.reduce((r, item) => {

View File

@ -64,7 +64,7 @@ const dataObject = {
vm.album = response[0].data vm.album = response[0].data
vm.tracks = new GroupedList(response[1].data) vm.tracks = new GroupedList(response[1].data)
vm.tracks.group(byMedium('disc_number')) vm.tracks.group(byMedium('disc_number'))
if (vm.tracks.indexList <= 1) { if (vm.tracks.indices <= 1) {
vm.tracks.group(noop()) vm.tracks.group(noop())
} }
} }

View File

@ -3,7 +3,7 @@
<tabs-music /> <tabs-music />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="albums.indexList" /> <index-button-list :indices="albums.indices" />
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="heading mb-5" v-text="$t('page.albums.filter')" /> <p class="heading mb-5" v-text="$t('page.albums.filter')" />

View File

@ -2,7 +2,7 @@
<div> <div>
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="tracks.indexList" /> <index-button-list :indices="tracks.indices" />
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="heading mb-5" v-text="$t('page.artist.filter')" /> <p class="heading mb-5" v-text="$t('page.artist.filter')" />

View File

@ -3,7 +3,7 @@
<tabs-music /> <tabs-music />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="artists.indexList" /> <index-button-list :indices="artists.indices" />
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="heading mb-5" v-text="$t('page.artists.filter')" /> <p class="heading mb-5" v-text="$t('page.artists.filter')" />

View File

@ -3,7 +3,7 @@
<tabs-audiobooks /> <tabs-audiobooks />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="albums.indexList" /> <index-button-list :indices="albums.indices" />
</template> </template>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.audiobooks.albums.title')" /> <p class="title is-4" v-text="$t('page.audiobooks.albums.title')" />

View File

@ -3,7 +3,7 @@
<tabs-audiobooks /> <tabs-audiobooks />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="artists.indexList" /> <index-button-list :indices="artists.indices" />
</template> </template>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.audiobooks.artists.title')" /> <p class="title is-4" v-text="$t('page.audiobooks.artists.title')" />

View File

@ -3,7 +3,7 @@
<tabs-audiobooks /> <tabs-audiobooks />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="genres.indexList" /> <index-button-list :indices="genres.indices" />
</template> </template>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.genres.title')" /> <p class="title is-4" v-text="$t('page.genres.title')" />

View File

@ -2,7 +2,7 @@
<div> <div>
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="tracks.indexList" /> <index-button-list :indices="tracks.indices" />
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="heading mb-5" v-text="$t('page.artist.sort.title')" /> <p class="heading mb-5" v-text="$t('page.artist.sort.title')" />

View File

@ -3,7 +3,7 @@
<tabs-music /> <tabs-music />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="composers.indexList" /> <index-button-list :indices="composers.indices" />
</template> </template>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.composers.title')" /> <p class="title is-4" v-text="$t('page.composers.title')" />

View File

@ -2,7 +2,7 @@
<div> <div>
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="albums_list.indexList" /> <index-button-list :indices="albums.indices" />
</template> </template>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="genre.name" /> <p class="title is-4" v-text="genre.name" />
@ -33,7 +33,7 @@
v-text="$t('page.genre.track-count', { count: genre.track_count })" v-text="$t('page.genre.track-count', { count: genre.track_count })"
/> />
</p> </p>
<list-albums :albums="albums_list" /> <list-albums :albums="albums" />
<modal-dialog-genre <modal-dialog-genre
:genre="genre" :genre="genre"
:media_kind="media_kind" :media_kind="media_kind"
@ -63,8 +63,8 @@ const dataObject = {
set(vm, response) { set(vm, response) {
vm.genre = response[0].data vm.genre = response[0].data
vm.albums_list = new GroupedList(response[1].data.albums) vm.albums = new GroupedList(response[1].data.albums)
vm.albums_list.group(byName('name_sort', true)) vm.albums.group(byName('name_sort', true))
} }
} }
@ -82,7 +82,7 @@ export default {
}) })
}, },
beforeRouteUpdate(to, from, next) { beforeRouteUpdate(to, from, next) {
if (!this.albums_list.isEmpty()) { if (!this.albums.isEmpty()) {
next() next()
return return
} }
@ -94,7 +94,7 @@ export default {
}, },
data() { data() {
return { return {
albums_list: new GroupedList(), albums: new GroupedList(),
genre: {}, genre: {},
media_kind: this.$route.query.media_kind, media_kind: this.$route.query.media_kind,
show_details_modal: false show_details_modal: false

View File

@ -2,7 +2,7 @@
<div> <div>
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="tracks.indexList" /> <index-button-list :indices="tracks.indices" />
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="heading mb-5" v-text="$t('page.genre.sort.title')" /> <p class="heading mb-5" v-text="$t('page.genre.sort.title')" />

View File

@ -3,7 +3,7 @@
<tabs-music /> <tabs-music />
<content-with-heading> <content-with-heading>
<template #options> <template #options>
<index-button-list :index="genres.indexList" /> <index-button-list :indices="genres.indices" />
</template> </template>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.genres.title')" /> <p class="title is-4" v-text="$t('page.genres.title')" />