[web] Streamline name of component properties to prepare for refactoring

This commit is contained in:
Alain Nussbaumer 2024-03-23 23:46:47 +01:00
parent 33d28b085f
commit 30aee058bf
34 changed files with 151 additions and 186 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<template v-for="album in albums" :key="album.itemId"> <template v-for="album in items" :key="album.itemId">
<div v-if="!album.isItem" class="mt-6 mb-5 py-2"> <div v-if="!album.isItem" class="mt-6 mb-5 py-2">
<span <span
:id="'index_' + album.index" :id="'index_' + album.index"
@ -8,7 +8,7 @@
/> />
</div> </div>
<div <div
v-else-if="album.isItem" v-else
class="media is-align-items-center" class="media is-align-items-center"
@click="open_album(album.item)" @click="open_album(album.item)"
> >
@ -78,17 +78,17 @@ export default {
name: 'ListAlbums', name: 'ListAlbums',
components: { CoverArtwork, ModalDialog, ModalDialogAlbum }, components: { CoverArtwork, ModalDialog, ModalDialogAlbum },
props: { props: {
albums: { required: true, type: Object }, items: { required: true, type: Object },
media_kind: { default: '', type: String } media_kind: { default: '', type: String }
}, },
emits: ['play-count-changed', 'podcast-deleted'], emits: ['play-count-changed', 'podcast-deleted'],
data() { data() {
return { return {
show_details_modal: false, rss_playlist_to_remove: {},
selected_album: {}, selected_album: {},
show_remove_podcast_modal: false, show_details_modal: false,
rss_playlist_to_remove: {} show_remove_podcast_modal: false
} }
}, },
@ -101,7 +101,7 @@ export default {
}, },
media_kind_resolved() { media_kind_resolved() {
return this.media_kind ? this.media_kind : this.selected_album.media_kind return this.media_kind || this.selected_album.media_kind
} }
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<template v-for="artist in artists" :key="artist.itemId"> <template v-for="artist in items" :key="artist.itemId">
<div v-if="!artist.isItem" class="mt-6 mb-5 py-2"> <div v-if="!artist.isItem" class="mt-6 mb-5 py-2">
<div class="media-content is-clipped"> <div class="media-content is-clipped">
<span <span
@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div <div
v-else-if="artist.isItem" v-else
class="media is-align-items-center" class="media is-align-items-center"
@click="open_artist(artist.item)" @click="open_artist(artist.item)"
> >
@ -40,7 +40,7 @@ export default {
name: 'ListArtists', name: 'ListArtists',
components: { ModalDialogArtist }, components: { ModalDialogArtist },
props: { props: {
artists: { required: true, type: Object } items: { required: true, type: Object }
}, },
data() { data() {

View File

@ -1,5 +1,5 @@
<template> <template>
<template v-for="composer in composers" :key="composer.itemId"> <template v-for="composer in items" :key="composer.itemId">
<div v-if="!composer.isItem" class="mt-6 mb-5 py-2"> <div v-if="!composer.isItem" class="mt-6 mb-5 py-2">
<div class="media-content is-clipped"> <div class="media-content is-clipped">
<span <span
@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div <div
v-else-if="composer.isItem" v-else
class="media is-align-items-center" class="media is-align-items-center"
@click="open_composer(composer.item)" @click="open_composer(composer.item)"
> >
@ -40,13 +40,13 @@ export default {
name: 'ListComposers', name: 'ListComposers',
components: { ModalDialogComposer }, components: { ModalDialogComposer },
props: { props: {
composers: { required: true, type: Object } items: { required: true, type: Object }
}, },
data() { data() {
return { return {
show_details_modal: false, selected_composer: {},
selected_composer: {} show_details_modal: false
} }
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<template v-for="genre in genres" :key="genre.itemId"> <template v-for="genre in items" :key="genre.itemId">
<div v-if="!genre.isItem" class="mt-6 mb-5 py-2"> <div v-if="!genre.isItem" class="mt-6 mb-5 py-2">
<div class="media-content is-clipped"> <div class="media-content is-clipped">
<span <span
@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div <div
v-else-if="genre.isItem" v-else
class="media is-align-items-center" class="media is-align-items-center"
@click="open_genre(genre.item)" @click="open_genre(genre.item)"
> >
@ -41,28 +41,28 @@ export default {
name: 'ListGenres', name: 'ListGenres',
components: { ModalDialogGenre }, components: { ModalDialogGenre },
props: { props: {
genres: { required: true, type: Object }, items: { required: true, type: Object },
media_kind: { required: true, type: String } media_kind: { required: true, type: String }
}, },
data() { data() {
return { return {
show_details_modal: false, selected_genre: {},
selected_genre: {} show_details_modal: false
} }
}, },
methods: { methods: {
open_dialog(genre) {
this.selected_genre = genre
this.show_details_modal = true
},
open_genre(genre) { open_genre(genre) {
this.$router.push({ this.$router.push({
name: 'genre-albums', name: 'genre-albums',
params: { name: genre.name }, params: { name: genre.name },
query: { media_kind: this.media_kind } query: { media_kind: this.media_kind }
}) })
},
open_dialog(genre) {
this.selected_genre = genre
this.show_details_modal = true
} }
} }
} }

View File

@ -4,16 +4,14 @@
<slot name="artwork" /> <slot name="artwork" />
</div> </div>
<div class="media-content is-clickable is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6" v-text="album.name" /> <h1 class="title is-6" v-text="item.name" />
<h2 <h2
class="subtitle is-7 has-text-grey has-text-weight-bold" class="subtitle is-7 has-text-grey has-text-weight-bold"
v-text="album.artists[0].name" v-text="item.artists[0]?.name"
/> />
<h2 <h2
class="subtitle is-7 has-text-grey" class="subtitle is-7 has-text-grey"
v-text=" v-text="[item.album_type, $filters.date(item.release_date)].join(', ')"
[album.album_type, $filters.date(album.release_date)].join(', ')
"
/> />
</div> </div>
<div class="media-right"> <div class="media-right">
@ -25,7 +23,7 @@
<script> <script>
export default { export default {
name: 'ListItemAlbumSpotify', name: 'ListItemAlbumSpotify',
props: { album: { required: true, type: Object } } props: { item: { required: true, type: Object } }
} }
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
v-for="playlist in playlists" v-for="playlist in items"
:key="playlist.itemId" :key="playlist.itemId"
class="media is-align-items-center" class="media is-align-items-center"
@click="open_playlist(playlist.item)" @click="open_playlist(playlist.item)"
@ -32,16 +32,28 @@ import ModalDialogPlaylist from '@/components/ModalDialogPlaylist.vue'
export default { export default {
name: 'ListPlaylists', name: 'ListPlaylists',
components: { ModalDialogPlaylist }, components: { ModalDialogPlaylist },
props: { playlists: { required: true, type: Object } }, props: { items: { required: true, type: Object } },
data() { data() {
return { return {
show_details_modal: false, selected_playlist: {},
selected_playlist: {} show_details_modal: false
} }
}, },
methods: { methods: {
icon_name(playlist) {
if (playlist.type === 'folder') {
return 'folder'
} else if (playlist.type === 'rss') {
return 'rss'
}
return 'music-box-multiple'
},
open_dialog(playlist) {
this.selected_playlist = playlist
this.show_details_modal = true
},
open_playlist(playlist) { open_playlist(playlist) {
if (playlist.type === 'folder') { if (playlist.type === 'folder') {
this.$router.push({ this.$router.push({
@ -54,20 +66,6 @@ export default {
params: { id: playlist.id } params: { id: playlist.id }
}) })
} }
},
open_dialog(playlist) {
this.selected_playlist = playlist
this.show_details_modal = true
},
icon_name(playlist) {
if (playlist.type === 'folder') {
return 'folder'
} else if (playlist.type === 'rss') {
return 'rss'
}
return 'music-box-multiple'
} }
} }
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<template v-for="track in tracks" :key="track.itemId"> <template v-for="track in items" :key="track.itemId">
<div v-if="!track.isItem" class="mt-6 mb-5 py-2"> <div v-if="!track.isItem" class="mt-6 mb-5 py-2">
<span <span
:id="'index_' + track.index" :id="'index_' + track.index"
@ -63,17 +63,17 @@ export default {
components: { ModalDialogTrack }, components: { ModalDialogTrack },
props: { props: {
expression: { default: '', type: String }, expression: { default: '', type: String },
items: { required: true, type: Object },
show_icon: Boolean, show_icon: Boolean,
show_progress: Boolean, show_progress: Boolean,
tracks: { required: true, type: Object },
uris: { default: '', type: String } uris: { default: '', type: String }
}, },
emits: ['play-count-changed'], emits: ['play-count-changed'],
data() { data() {
return { return {
show_details_modal: false, selected_track: {},
selected_track: {} show_details_modal: false
} }
}, },
@ -82,19 +82,18 @@ export default {
this.selected_track = track this.selected_track = track
this.show_details_modal = true this.show_details_modal = true
}, },
play_track(track) { play_track(track) {
if (this.uris) { if (this.uris) {
webapi.player_play_uri( webapi.player_play_uri(
this.uris, this.uris,
false, false,
this.tracks.items.indexOf(track) this.items.items.indexOf(track)
) )
} else if (this.expression) { } else if (this.expression) {
webapi.player_play_expression( webapi.player_play_expression(
this.expression, this.expression,
false, false,
this.tracks.items.indexOf(track) this.items.items.indexOf(track)
) )
} else { } else {
webapi.player_play_uri(track.uri, false) webapi.player_play_uri(track.uri, false)

View File

@ -50,7 +50,7 @@
v-text="$filters.date(album.date_released)" v-text="$filters.date(album.date_released)"
/> />
</p> </p>
<p v-else-if="album.year > 0"> <p v-else-if="album.year">
<span class="heading" v-text="$t('dialog.album.year')" /> <span class="heading" v-text="$t('dialog.album.year')" />
<span class="title is-6" v-text="album.year" /> <span class="title is-6" v-text="album.year" />
</p> </p>
@ -133,7 +133,7 @@ export default {
computed: { computed: {
media_kind_resolved() { media_kind_resolved() {
return this.media_kind ? this.media_kind : this.album.media_kind return this.media_kind || this.album.media_kind
} }
}, },
@ -192,14 +192,6 @@ export default {
this.$emit('play-count-changed') this.$emit('play-count-changed')
this.$emit('close') this.$emit('close')
}) })
},
artwork_loaded() {
this.artwork_visible = true
},
artwork_error() {
this.artwork_visible = false
} }
} }
} }

View File

@ -33,7 +33,7 @@
class="heading has-text-centered-mobile mt-5" class="heading has-text-centered-mobile mt-5"
v-text="$t('page.album.track-count', { count: album.track_count })" v-text="$t('page.album.track-count', { count: album.track_count })"
/> />
<list-tracks :tracks="tracks" :uris="album.uri" /> <list-tracks :items="tracks" :uris="album.uri" />
<modal-dialog-album <modal-dialog-album
:show="show_details_modal" :show="show_details_modal"
:album="album" :album="album"
@ -45,9 +45,9 @@
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHero from '@/templates/ContentWithHero.vue' import ContentWithHero from '@/templates/ContentWithHero.vue'
import CoverArtwork from '@/components/CoverArtwork.vue' import CoverArtwork from '@/components/CoverArtwork.vue'
import { GroupedList } from '@/lib/GroupedList'
import ListTracks from '@/components/ListTracks.vue' import ListTracks from '@/components/ListTracks.vue'
import ModalDialogAlbum from '@/components/ModalDialogAlbum.vue' import ModalDialogAlbum from '@/components/ModalDialogAlbum.vue'
import webapi from '@/webapi' import webapi from '@/webapi'

View File

@ -56,7 +56,7 @@
</template> </template>
<template #heading-right /> <template #heading-right />
<template #content> <template #content>
<list-albums :albums="albums" /> <list-albums :items="albums" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -64,9 +64,9 @@
<script> <script>
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ControlDropdown from '@/components/ControlDropdown.vue' import ControlDropdown from '@/components/ControlDropdown.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListAlbums from '@/components/ListAlbums.vue' import ListAlbums from '@/components/ListAlbums.vue'
import TabsMusic from '@/components/TabsMusic.vue' import TabsMusic from '@/components/TabsMusic.vue'
@ -119,7 +119,7 @@ export default {
id: 2, id: 2,
name: this.$t('page.albums.sort.recently-added'), name: this.$t('page.albums.sort.recently-added'),
options: { options: {
criteria: [{ field: 'time_added', type: Date, order: -1 }], criteria: [{ field: 'time_added', order: -1, type: Date }],
index: { field: 'time_added', type: Date } index: { field: 'time_added', type: Date }
} }
}, },
@ -127,7 +127,7 @@ export default {
id: 3, id: 3,
name: this.$t('page.albums.sort.recently-released'), name: this.$t('page.albums.sort.recently-released'),
options: { options: {
criteria: [{ field: 'date_released', type: Date, order: -1 }], criteria: [{ field: 'date_released', order: -1, type: Date }],
index: { field: 'date_released', type: Date } index: { field: 'date_released', type: Date }
} }
}, },
@ -170,20 +170,6 @@ export default {
return this.albums_list return this.albums_list
}, },
selected_grouping_option_id: {
get() {
return this.$store.state.albums_sort
},
set(value) {
this.$store.commit(types.ALBUMS_SORT, value)
}
},
spotify_enabled() {
return this.$store.state.spotify.webapi_token_valid
},
hide_singles: { hide_singles: {
get() { get() {
return this.$store.state.hide_singles return this.$store.state.hide_singles
@ -192,7 +178,6 @@ export default {
this.$store.commit(types.HIDE_SINGLES, value) this.$store.commit(types.HIDE_SINGLES, value)
} }
}, },
hide_spotify: { hide_spotify: {
get() { get() {
return this.$store.state.hide_spotify return this.$store.state.hide_spotify
@ -200,6 +185,17 @@ export default {
set(value) { set(value) {
this.$store.commit(types.HIDE_SPOTIFY, value) this.$store.commit(types.HIDE_SPOTIFY, value)
} }
},
selected_grouping_option_id: {
get() {
return this.$store.state.albums_sort
},
set(value) {
this.$store.commit(types.ALBUMS_SORT, value)
}
},
spotify_enabled() {
return this.$store.state.spotify.webapi_token_valid
} }
} }
} }

View File

@ -59,7 +59,7 @@
v-text="$t('page.artist.track-count', { count: track_count })" v-text="$t('page.artist.track-count', { count: track_count })"
/> />
</p> </p>
<list-albums :albums="albums" /> <list-albums :items="albums" />
<modal-dialog-artist <modal-dialog-artist
:show="show_details_modal" :show="show_details_modal"
:artist="artist" :artist="artist"
@ -72,9 +72,9 @@
<script> <script>
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ControlDropdown from '@/components/ControlDropdown.vue' import ControlDropdown from '@/components/ControlDropdown.vue'
import { GroupedList } from '@/lib/GroupedList'
import ListAlbums from '@/components/ListAlbums.vue' import ListAlbums from '@/components/ListAlbums.vue'
import ModalDialogArtist from '@/components/ModalDialogArtist.vue' import ModalDialogArtist from '@/components/ModalDialogArtist.vue'
import webapi from '@/webapi' import webapi from '@/webapi'
@ -117,8 +117,8 @@ export default {
data() { data() {
return { return {
artist: {},
albums_list: new GroupedList(), albums_list: new GroupedList(),
artist: {},
grouping_options: [ grouping_options: [
{ {
id: 1, id: 1,
@ -181,7 +181,6 @@ export default {
params: { id: this.artist.id } params: { id: this.artist.id }
}) })
}, },
play() { play() {
webapi.player_play_uri( webapi.player_play_uri(
this.albums.items.map((a) => a.uri).join(','), this.albums.items.map((a) => a.uri).join(','),

View File

@ -26,7 +26,7 @@
<list-item-album-spotify <list-item-album-spotify
v-for="album in albums" v-for="album in albums"
:key="album.id" :key="album.id"
:album="album" :item="album"
@click="open_album(album)" @click="open_album(album)"
> >
<template v-if="is_visible_artwork" #artwork> <template v-if="is_visible_artwork" #artwork>
@ -157,6 +157,17 @@ export default {
}, },
methods: { methods: {
append_albums(data) {
this.albums = this.albums.concat(data.items)
this.total = data.total
this.offset += data.limit
},
artwork_url(album) {
if (album.images && album.images.length > 0) {
return album.images[0].url
}
return ''
},
load_next({ loaded }) { load_next({ loaded }) {
const spotifyApi = new SpotifyWebApi() const spotifyApi = new SpotifyWebApi()
spotifyApi.setAccessToken(this.$store.state.spotify.webapi_token) spotifyApi.setAccessToken(this.$store.state.spotify.webapi_token)
@ -171,35 +182,19 @@ export default {
loaded(data.items.length, PAGE_SIZE) loaded(data.items.length, PAGE_SIZE)
}) })
}, },
append_albums(data) {
this.albums = this.albums.concat(data.items)
this.total = data.total
this.offset += data.limit
},
play() {
this.show_album_details_modal = false
webapi.player_play_uri(this.artist.uri, true)
},
open_album(album) { open_album(album) {
this.$router.push({ this.$router.push({
name: 'music-spotify-album', name: 'music-spotify-album',
params: { id: album.id } params: { id: album.id }
}) })
}, },
open_dialog(album) { open_dialog(album) {
this.selected_album = album this.selected_album = album
this.show_album_details_modal = true this.show_album_details_modal = true
}, },
play() {
artwork_url(album) { this.show_album_details_modal = false
if (album.images && album.images.length > 0) { webapi.player_play_uri(this.artist.uri, true)
return album.images[0].url
}
return ''
} }
} }
} }

View File

@ -60,7 +60,7 @@
v-text="$t('page.artist.track-count', { count: tracks.count })" v-text="$t('page.artist.track-count', { count: tracks.count })"
/> />
</p> </p>
<list-tracks :tracks="tracks" :uris="track_uris" /> <list-tracks :items="tracks" :uris="track_uris" />
<modal-dialog-artist <modal-dialog-artist
:show="show_details_modal" :show="show_details_modal"
:artist="artist" :artist="artist"
@ -73,9 +73,9 @@
<script> <script>
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ControlDropdown from '@/components/ControlDropdown.vue' import ControlDropdown from '@/components/ControlDropdown.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListTracks from '@/components/ListTracks.vue' import ListTracks from '@/components/ListTracks.vue'
import ModalDialogArtist from '@/components/ModalDialogArtist.vue' import ModalDialogArtist from '@/components/ModalDialogArtist.vue'
@ -168,6 +168,9 @@ export default {
spotify_enabled() { spotify_enabled() {
return this.$store.state.spotify.webapi_token_valid return this.$store.state.spotify.webapi_token_valid
}, },
track_uris() {
return this.tracks_list.items.map((a) => a.uri).join(',')
},
tracks() { tracks() {
const grouping = this.grouping_options.find( const grouping = this.grouping_options.find(
(o) => o.id === this.selected_grouping_option_id (o) => o.id === this.selected_grouping_option_id
@ -177,9 +180,6 @@ export default {
] ]
this.tracks_list.group(grouping.options) this.tracks_list.group(grouping.options)
return this.tracks_list return this.tracks_list
},
track_uris() {
return this.tracks_list.items.map((a) => a.uri).join(',')
} }
}, },
@ -191,7 +191,6 @@ export default {
params: { id: this.artist.id } params: { id: this.artist.id }
}) })
}, },
play() { play() {
webapi.player_play_uri( webapi.player_play_uri(
this.tracks_list.items.map((a) => a.uri).join(','), this.tracks_list.items.map((a) => a.uri).join(','),

View File

@ -56,7 +56,7 @@
</template> </template>
<template #heading-right /> <template #heading-right />
<template #content> <template #content>
<list-artists :artists="artists" /> <list-artists :items="artists" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -64,9 +64,9 @@
<script> <script>
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ControlDropdown from '@/components/ControlDropdown.vue' import ControlDropdown from '@/components/ControlDropdown.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListArtists from '@/components/ListArtists.vue' import ListArtists from '@/components/ListArtists.vue'
import TabsMusic from '@/components/TabsMusic.vue' import TabsMusic from '@/components/TabsMusic.vue'
@ -133,7 +133,6 @@ export default {
if (!this.artists_list) { if (!this.artists_list) {
return [] return []
} }
const grouping = this.grouping_options.find( const grouping = this.grouping_options.find(
(o) => o.id === this.selected_grouping_option_id (o) => o.id === this.selected_grouping_option_id
) )
@ -143,23 +142,8 @@ export default {
(artist) => !this.hide_spotify || artist.data_kind !== 'spotify' (artist) => !this.hide_spotify || artist.data_kind !== 'spotify'
] ]
this.artists_list.group(grouping.options) this.artists_list.group(grouping.options)
return this.artists_list return this.artists_list
}, },
selected_grouping_option_id: {
get() {
return this.$store.state.artists_sort
},
set(value) {
this.$store.commit(types.ARTISTS_SORT, value)
}
},
spotify_enabled() {
return this.$store.state.spotify.webapi_token_valid
},
hide_singles: { hide_singles: {
get() { get() {
return this.$store.state.hide_singles return this.$store.state.hide_singles
@ -168,7 +152,6 @@ export default {
this.$store.commit(types.HIDE_SINGLES, value) this.$store.commit(types.HIDE_SINGLES, value)
} }
}, },
hide_spotify: { hide_spotify: {
get() { get() {
return this.$store.state.hide_spotify return this.$store.state.hide_spotify
@ -176,6 +159,17 @@ export default {
set(value) { set(value) {
this.$store.commit(types.HIDE_SPOTIFY, value) this.$store.commit(types.HIDE_SPOTIFY, value)
} }
},
selected_grouping_option_id: {
get() {
return this.$store.state.artists_sort
},
set(value) {
this.$store.commit(types.ARTISTS_SORT, value)
}
},
spotify_enabled() {
return this.$store.state.spotify.webapi_token_valid
} }
} }
} }

View File

@ -37,7 +37,7 @@
}) })
" "
/> />
<list-tracks :tracks="tracks" :uris="album.uri" /> <list-tracks :items="tracks" :uris="album.uri" />
<modal-dialog-album <modal-dialog-album
:show="show_details_modal" :show="show_details_modal"
:album="album" :album="album"
@ -104,7 +104,6 @@ export default {
params: { id: this.album.artist_id } params: { id: this.album.artist_id }
}) })
}, },
play() { play() {
webapi.player_play_uri(this.album.uri, false) webapi.player_play_uri(this.album.uri, false)
} }

View File

@ -13,15 +13,15 @@
/> />
</template> </template>
<template #content> <template #content>
<list-albums :albums="albums" /> <list-albums :items="albums" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListAlbums from '@/components/ListAlbums.vue' import ListAlbums from '@/components/ListAlbums.vue'
import TabsAudiobooks from '@/components/TabsAudiobooks.vue' import TabsAudiobooks from '@/components/TabsAudiobooks.vue'
@ -42,10 +42,10 @@ const dataObject = {
export default { export default {
name: 'PageAudiobooksAlbums', name: 'PageAudiobooksAlbums',
components: { components: {
TabsAudiobooks,
ContentWithHeading, ContentWithHeading,
IndexButtonList, IndexButtonList,
ListAlbums ListAlbums,
TabsAudiobooks
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {

View File

@ -27,7 +27,7 @@
}) })
" "
/> />
<list-albums :albums="albums" /> <list-albums :items="albums" />
<modal-dialog-artist <modal-dialog-artist
:show="show_details_modal" :show="show_details_modal"
:artist="artist" :artist="artist"

View File

@ -14,15 +14,15 @@
</template> </template>
<template #heading-right /> <template #heading-right />
<template #content> <template #content>
<list-artists :artists="artists" /> <list-artists :items="artists" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListArtists from '@/components/ListArtists.vue' import ListArtists from '@/components/ListArtists.vue'
import TabsAudiobooks from '@/components/TabsAudiobooks.vue' import TabsAudiobooks from '@/components/TabsAudiobooks.vue'
@ -44,9 +44,9 @@ export default {
name: 'PageAudiobooksArtists', name: 'PageAudiobooksArtists',
components: { components: {
ContentWithHeading, ContentWithHeading,
TabsAudiobooks,
IndexButtonList, IndexButtonList,
ListArtists ListArtists,
TabsAudiobooks
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {

View File

@ -13,15 +13,15 @@
/> />
</template> </template>
<template #content> <template #content>
<list-genres :genres="genres" :media_kind="'audiobook'" /> <list-genres :items="genres" :media_kind="'audiobook'" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListGenres from '@/components/ListGenres.vue' import ListGenres from '@/components/ListGenres.vue'
import TabsAudiobooks from '@/components/TabsAudiobooks.vue' import TabsAudiobooks from '@/components/TabsAudiobooks.vue'

View File

@ -34,7 +34,7 @@
" "
/> />
</p> </p>
<list-albums :albums="albums" /> <list-albums :items="albums" />
<modal-dialog-composer <modal-dialog-composer
:show="show_details_modal" :show="show_details_modal"
:composer="composer" :composer="composer"
@ -102,7 +102,6 @@ export default {
params: { name: this.composer.name } params: { name: this.composer.name }
}) })
}, },
play() { play() {
webapi.player_play_expression( webapi.player_play_expression(
`composer is "${this.composer.name}" and media_kind is music`, `composer is "${this.composer.name}" and media_kind is music`,

View File

@ -48,7 +48,7 @@
" "
/> />
</p> </p>
<list-tracks :tracks="tracks" :expression="expression" /> <list-tracks :items="tracks" :expression="expression" />
<modal-dialog-composer <modal-dialog-composer
:show="show_details_modal" :show="show_details_modal"
:composer="composer" :composer="composer"
@ -61,9 +61,9 @@
<script> <script>
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ControlDropdown from '@/components/ControlDropdown.vue' import ControlDropdown from '@/components/ControlDropdown.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListTracks from '@/components/ListTracks.vue' import ListTracks from '@/components/ListTracks.vue'
import ModalDialogComposer from '@/components/ModalDialogComposer.vue' import ModalDialogComposer from '@/components/ModalDialogComposer.vue'
@ -158,7 +158,6 @@ export default {
params: { name: this.composer.name } params: { name: this.composer.name }
}) })
}, },
play() { play() {
webapi.player_play_expression(this.expression, true) webapi.player_play_expression(this.expression, true)
} }

View File

@ -13,15 +13,15 @@
/> />
</template> </template>
<template #content> <template #content>
<list-composers :composers="composers" /> <list-composers :items="composers" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListComposers from '@/components/ListComposers.vue' import ListComposers from '@/components/ListComposers.vue'
import TabsMusic from '@/components/TabsMusic.vue' import TabsMusic from '@/components/TabsMusic.vue'

View File

@ -21,10 +21,10 @@
</template> </template>
<template #content> <template #content>
<list-directories :directories="dirs" /> <list-directories :directories="dirs" />
<list-playlists :playlists="playlists" /> <list-playlists :items="playlists" />
<list-tracks <list-tracks
:tracks="tracks"
:expression="play_expression" :expression="play_expression"
:items="tracks"
:show_icon="true" :show_icon="true"
/> />
<modal-dialog-directory <modal-dialog-directory
@ -94,8 +94,8 @@ export default {
return { return {
dirs: [], dirs: [],
playlists: new GroupedList(), playlists: new GroupedList(),
tracks: new GroupedList(), show_details_modal: false,
show_details_modal: false tracks: new GroupedList()
} }
}, },
@ -106,7 +106,6 @@ export default {
} }
return '/' return '/'
}, },
play_expression() { play_expression() {
return `path starts with "${this.current_directory}" order by path asc` return `path starts with "${this.current_directory}" order by path asc`
} }

View File

@ -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-albums :items="albums" />
<modal-dialog-genre <modal-dialog-genre
:genre="genre" :genre="genre"
:media_kind="media_kind" :media_kind="media_kind"
@ -46,8 +46,8 @@
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListAlbums from '@/components/ListAlbums.vue' import ListAlbums from '@/components/ListAlbums.vue'
import ModalDialogGenre from '@/components/ModalDialogGenre.vue' import ModalDialogGenre from '@/components/ModalDialogGenre.vue'
@ -106,7 +106,6 @@ export default {
query: { media_kind: this.media_kind } query: { media_kind: this.media_kind }
}) })
}, },
play() { play() {
webapi.player_play_expression( webapi.player_play_expression(
`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`, `genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,

View File

@ -42,7 +42,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-tracks :tracks="tracks" :expression="expression" /> <list-tracks :items="tracks" :expression="expression" />
<modal-dialog-genre <modal-dialog-genre
:show="show_details_modal" :show="show_details_modal"
:genre="genre" :genre="genre"
@ -56,9 +56,9 @@
<script> <script>
import * as types from '@/store/mutation_types' import * as types from '@/store/mutation_types'
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ControlDropdown from '@/components/ControlDropdown.vue' import ControlDropdown from '@/components/ControlDropdown.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListTracks from '@/components/ListTracks.vue' import ListTracks from '@/components/ListTracks.vue'
import ModalDialogGenre from '@/components/ModalDialogGenre.vue' import ModalDialogGenre from '@/components/ModalDialogGenre.vue'

View File

@ -13,15 +13,15 @@
/> />
</template> </template>
<template #content> <template #content>
<list-genres :genres="genres" :media_kind="'music'" /> <list-genres :items="genres" :media_kind="'music'" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import IndexButtonList from '@/components/IndexButtonList.vue' import IndexButtonList from '@/components/IndexButtonList.vue'
import ListGenres from '@/components/ListGenres.vue' import ListGenres from '@/components/ListGenres.vue'
import TabsMusic from '@/components/TabsMusic.vue' import TabsMusic from '@/components/TabsMusic.vue'

View File

@ -7,7 +7,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 :albums="recently_added" /> <list-albums :items="recently_added" />
</template> </template>
<template #footer> <template #footer>
<nav class="level"> <nav class="level">
@ -27,7 +27,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 :tracks="recently_played" /> <list-tracks :items="recently_played" />
</template> </template>
<template #footer> <template #footer>
<nav class="level"> <nav class="level">
@ -56,16 +56,16 @@ const dataObject = {
load(to) { load(to) {
return Promise.all([ return Promise.all([
webapi.search({ webapi.search({
type: 'album',
expression: expression:
'time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc', 'time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc',
limit: 3 limit: 3,
type: 'album'
}), }),
webapi.search({ webapi.search({
type: 'track',
expression: expression:
'time_played after 8 weeks ago and media_kind is music order by time_played desc', 'time_played after 8 weeks ago and media_kind is music order by time_played desc',
limit: 3 limit: 3,
type: 'track'
}) })
]) ])
}, },

View File

@ -6,15 +6,15 @@
<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 :albums="recently_added" /> <list-albums :items="recently_added" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import ListAlbums from '@/components/ListAlbums.vue' import ListAlbums from '@/components/ListAlbums.vue'
import TabsMusic from '@/components/TabsMusic.vue' import TabsMusic from '@/components/TabsMusic.vue'
import store from '@/store' import store from '@/store'
@ -24,10 +24,10 @@ const dataObject = {
load(to) { load(to) {
const limit = store.getters.settings_option_recently_added_limit const limit = store.getters.settings_option_recently_added_limit
return webapi.search({ return webapi.search({
type: 'album',
expression: expression:
'media_kind is music having track_count > 3 order by time_added desc', 'media_kind is music having track_count > 3 order by time_added desc',
limit limit,
type: 'album'
}) })
}, },

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 :tracks="recently_played" /> <list-tracks :items="recently_played" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
@ -22,10 +22,10 @@ import webapi from '@/webapi'
const dataObject = { const dataObject = {
load(to) { load(to) {
return webapi.search({ return webapi.search({
type: 'track',
expression: expression:
'time_played after 8 weeks ago and media_kind is music order by time_played desc', 'time_played after 8 weeks ago and media_kind is music order by time_played desc',
limit: 50 limit: 50,
type: 'track'
}) })
}, },

View File

@ -9,7 +9,7 @@
<list-item-album-spotify <list-item-album-spotify
v-for="album in new_releases" v-for="album in new_releases"
:key="album.id" :key="album.id"
:album="album" :item="album"
@click="open_album(album)" @click="open_album(album)"
> >
<template v-if="is_visible_artwork" #artwork> <template v-if="is_visible_artwork" #artwork>

View File

@ -14,15 +14,15 @@
/> />
</template> </template>
<template #content> <template #content>
<list-playlists :playlists="playlists" /> <list-playlists :items="playlists" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>
</template> </template>
<script> <script>
import { GroupedList } from '@/lib/GroupedList'
import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import { GroupedList } from '@/lib/GroupedList'
import ListPlaylists from '@/components/ListPlaylists.vue' import ListPlaylists from '@/components/ListPlaylists.vue'
import webapi from '@/webapi' import webapi from '@/webapi'

View File

@ -23,7 +23,7 @@
class="heading has-text-centered-mobile" class="heading has-text-centered-mobile"
v-text="$t('page.playlist.track-count', { count: tracks.count })" v-text="$t('page.playlist.track-count', { count: tracks.count })"
/> />
<list-tracks :tracks="tracks" :uris="uris" /> <list-tracks :items="tracks" :uris="uris" />
<modal-dialog-playlist <modal-dialog-playlist
:show="show_details_modal" :show="show_details_modal"
:playlist="playlist" :playlist="playlist"

View File

@ -14,7 +14,7 @@
</template> </template>
<template #content> <template #content>
<list-tracks <list-tracks
:tracks="new_episodes" :items="new_episodes"
:show_progress="true" :show_progress="true"
@play-count-changed="reload_new_episodes" @play-count-changed="reload_new_episodes"
/> />

View File

@ -9,7 +9,7 @@
/> />
</template> </template>
<template #content> <template #content>
<list-tracks :tracks="tracks" /> <list-tracks :items="tracks" />
</template> </template>
</content-with-heading> </content-with-heading>
</div> </div>