[web] Simplify variable naming

This commit is contained in:
Alain Nussbaumer 2024-04-27 20:36:04 +02:00
parent c255b3a108
commit 4ae2903b4d
6 changed files with 24 additions and 28 deletions

View File

@ -1,13 +1,12 @@
<template> <template>
<div class="fd-page-with-tabs"> <div class="fd-page-with-tabs">
<tabs-music /> <tabs-music />
<!-- Recently added -->
<content-with-heading> <content-with-heading>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.music.recently-added.title')" /> <p class="title is-4" v-text="$t('page.music.recently-added.title')" />
</template> </template>
<template #content> <template #content>
<list-albums :items="recently_added" /> <list-albums :items="albums" />
</template> </template>
<template #footer> <template #footer>
<nav class="level"> <nav class="level">
@ -22,13 +21,12 @@
</nav> </nav>
</template> </template>
</content-with-heading> </content-with-heading>
<!-- Recently played -->
<content-with-heading> <content-with-heading>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.music.recently-played.title')" /> <p class="title is-4" v-text="$t('page.music.recently-played.title')" />
</template> </template>
<template #content> <template #content>
<list-tracks :items="recently_played" /> <list-tracks :items="tracks" />
</template> </template>
<template #footer> <template #footer>
<nav class="level"> <nav class="level">
@ -73,8 +71,8 @@ const dataObject = {
}, },
set(vm, response) { set(vm, response) {
vm.recently_added = new GroupedList(response[0].data.albums) vm.albums = new GroupedList(response[0].data.albums)
vm.recently_played = new GroupedList(response[1].data.tracks) vm.tracks = new GroupedList(response[1].data.tracks)
} }
} }
@ -90,8 +88,8 @@ export default {
data() { data() {
return { return {
recently_added: [], albums: [],
recently_played: { items: [] }, tracks: { items: [] },
selected_track: {} selected_track: {}
} }
} }

View File

@ -6,7 +6,7 @@
<p class="title is-4" v-text="$t('page.music.recently-added.title')" /> <p class="title is-4" v-text="$t('page.music.recently-added.title')" />
</template> </template>
<template #content> <template #content>
<list-albums :items="recently_added" /> <list-albums :items="albums" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -32,7 +32,7 @@ const dataObject = {
}, },
set(vm, response) { set(vm, response) {
vm.recently_added = new GroupedList(response.data.albums, { vm.albums = new GroupedList(response.data.albums, {
criteria: [{ field: 'time_added', order: -1, type: Date }], criteria: [{ field: 'time_added', order: -1, type: Date }],
index: { field: 'time_added', type: Date } index: { field: 'time_added', type: Date }
}) })
@ -51,7 +51,7 @@ export default {
data() { data() {
return { return {
recently_added: new GroupedList() albums: new GroupedList()
} }
} }
} }

View File

@ -6,7 +6,7 @@
<p class="title is-4" v-text="$t('page.music.recently-played.title')" /> <p class="title is-4" v-text="$t('page.music.recently-played.title')" />
</template> </template>
<template #content> <template #content>
<list-tracks :items="recently_played" /> <list-tracks :items="tracks" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -30,7 +30,7 @@ const dataObject = {
}, },
set(vm, response) { set(vm, response) {
vm.recently_played = new GroupedList(response.data.tracks) vm.tracks = new GroupedList(response.data.tracks)
} }
} }
@ -46,7 +46,7 @@ export default {
data() { data() {
return { return {
recently_played: {} tracks: {}
} }
} }
} }

View File

@ -1,13 +1,12 @@
<template> <template>
<div class="fd-page-with-tabs"> <div class="fd-page-with-tabs">
<tabs-music /> <tabs-music />
<!-- New Releases -->
<content-with-heading> <content-with-heading>
<template #heading-left> <template #heading-left>
<p class="title is-4" v-text="$t('page.spotify.music.new-releases')" /> <p class="title is-4" v-text="$t('page.spotify.music.new-releases')" />
</template> </template>
<template #content> <template #content>
<list-albums-spotify :items="new_releases" /> <list-albums-spotify :items="albums" />
</template> </template>
<template #footer> <template #footer>
<nav class="level"> <nav class="level">
@ -22,7 +21,6 @@
</nav> </nav>
</template> </template>
</content-with-heading> </content-with-heading>
<!-- Featured Playlists -->
<content-with-heading> <content-with-heading>
<template #heading-left> <template #heading-left>
<p <p
@ -31,7 +29,7 @@
/> />
</template> </template>
<template #content> <template #content>
<list-playlists-spotify :items="featured_playlists" /> <list-playlists-spotify :items="playlists" />
</template> </template>
<template #footer> <template #footer>
<nav class="level"> <nav class="level">
@ -76,8 +74,8 @@ const dataObject = {
}, },
set(vm, response) { set(vm, response) {
vm.new_releases = response[0].albums.items vm.albums = response[0].albums.items
vm.featured_playlists = response[1].playlists.items vm.playlists = response[1].playlists.items
} }
} }
@ -98,8 +96,8 @@ export default {
data() { data() {
return { return {
featured_playlists: [], playlists: [],
new_releases: [] albums: []
} }
} }
} }

View File

@ -9,7 +9,7 @@
/> />
</template> </template>
<template #content> <template #content>
<list-playlists-spotify :items="featured_playlists" /> <list-playlists-spotify :items="playlists" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -35,7 +35,7 @@ const dataObject = {
}, },
set(vm, response) { set(vm, response) {
vm.featured_playlists = response.playlists.items vm.playlists = response.playlists.items
} }
} }
@ -55,7 +55,7 @@ export default {
data() { data() {
return { return {
featured_playlists: [] playlists: []
} }
} }
} }

View File

@ -6,7 +6,7 @@
<p class="title is-4" v-text="$t('page.spotify.music.new-releases')" /> <p class="title is-4" v-text="$t('page.spotify.music.new-releases')" />
</template> </template>
<template #content> <template #content>
<list-albums-spotify :items="new_releases" /> <list-albums-spotify :items="albums" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -32,7 +32,7 @@ const dataObject = {
}, },
set(vm, response) { set(vm, response) {
vm.new_releases = response.albums.items vm.albums = response.albums.items
} }
} }
@ -52,7 +52,7 @@ export default {
data() { data() {
return { return {
new_releases: [] albums: []
} }
} }
} }