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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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