mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-05 02:38:09 -05:00
[web-src] Refactor track and playlis listings
This commit is contained in:
parent
43899d198f
commit
ee4ec0c9eb
54
web-src/src/components/ListPlaylists.vue
Normal file
54
web-src/src/components/ListPlaylists.vue
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<list-item-playlist v-for="playlist in playlists" :key="playlist.id" :playlist="playlist" @click="open_playlist(playlist)">
|
||||||
|
<template slot="icon">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="mdi" :class="{ 'mdi-library-music': playlist.type !== 'folder', 'mdi-rss': playlist.type === 'rss', 'mdi-folder': playlist.type === 'folder' }"></i>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template slot="actions">
|
||||||
|
<a @click="open_dialog(playlist)">
|
||||||
|
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</list-item-playlist>
|
||||||
|
<modal-dialog-playlist :show="show_details_modal" :playlist="selected_playlist" @close="show_details_modal = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ListItemPlaylist from '@/components/ListItemPlaylist'
|
||||||
|
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ListPlaylists',
|
||||||
|
components: { ListItemPlaylist, ModalDialogPlaylist },
|
||||||
|
|
||||||
|
props: ['playlists'],
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
show_details_modal: false,
|
||||||
|
selected_playlist: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
open_playlist: function (playlist) {
|
||||||
|
if (playlist.type !== 'folder') {
|
||||||
|
this.$router.push({ path: '/playlists/' + playlist.id + '/tracks' })
|
||||||
|
} else {
|
||||||
|
this.$router.push({ path: '/playlists/' + playlist.id })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
open_dialog: function (playlist) {
|
||||||
|
this.selected_playlist = playlist
|
||||||
|
this.show_details_modal = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
52
web-src/src/components/ListTracks.vue
Normal file
52
web-src/src/components/ListTracks.vue
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<list-item-track v-for="(track, index) in tracks" :key="track.id" :track="track" @click="play_track(index, track)">
|
||||||
|
<template slot="actions">
|
||||||
|
<a @click="open_dialog(track)">
|
||||||
|
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</list-item-track>
|
||||||
|
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ListItemTrack from '@/components/ListItemTrack'
|
||||||
|
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
||||||
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ListTracks',
|
||||||
|
components: { ListItemTrack, ModalDialogTrack },
|
||||||
|
|
||||||
|
props: ['tracks', 'uris', 'expression'],
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
show_details_modal: false,
|
||||||
|
selected_track: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
play_track: function (position, track) {
|
||||||
|
if (this.uris) {
|
||||||
|
webapi.player_play_uri(this.uris, false, position)
|
||||||
|
} else if (this.expression) {
|
||||||
|
webapi.player_play_expression(this.expression, false, position)
|
||||||
|
} else {
|
||||||
|
webapi.player_play_uri(track.uri, false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
open_dialog: function (track) {
|
||||||
|
this.selected_track = track
|
||||||
|
this.show_details_modal = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
@ -24,14 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<p class="heading is-7 has-text-centered-mobile fd-has-margin-top">{{ album.track_count }} tracks</p>
|
<p class="heading is-7 has-text-centered-mobile fd-has-margin-top">{{ album.track_count }} tracks</p>
|
||||||
<list-item-track v-for="(track, index) in tracks" :key="track.id" :track="track" @click="play_track(index)">
|
<list-tracks :tracks="tracks" :uris="album.uri"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
<modal-dialog-album :show="show_album_details_modal" :album="album" @close="show_album_details_modal = false" />
|
<modal-dialog-album :show="show_album_details_modal" :album="album" @close="show_album_details_modal = false" />
|
||||||
</template>
|
</template>
|
||||||
</content-with-hero>
|
</content-with-hero>
|
||||||
@ -40,8 +33,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHero from '@/templates/ContentWithHero'
|
import ContentWithHero from '@/templates/ContentWithHero'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
|
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
|
||||||
import CoverArtwork from '@/components/CoverArtwork'
|
import CoverArtwork from '@/components/CoverArtwork'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
@ -63,16 +55,13 @@ const albumData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageAlbum',
|
name: 'PageAlbum',
|
||||||
mixins: [LoadDataBeforeEnterMixin(albumData)],
|
mixins: [LoadDataBeforeEnterMixin(albumData)],
|
||||||
components: { ContentWithHero, ListItemTrack, ModalDialogTrack, ModalDialogAlbum, CoverArtwork },
|
components: { ContentWithHero, ListTracks, ModalDialogAlbum, CoverArtwork },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
album: {},
|
album: {},
|
||||||
tracks: [],
|
tracks: [],
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {},
|
|
||||||
|
|
||||||
show_album_details_modal: false
|
show_album_details_modal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -85,15 +74,6 @@ export default {
|
|||||||
|
|
||||||
play: function () {
|
play: function () {
|
||||||
webapi.player_play_uri(this.album.uri, true)
|
webapi.player_play_uri(this.album.uri, true)
|
||||||
},
|
|
||||||
|
|
||||||
play_track: function (position) {
|
|
||||||
webapi.player_play_uri(this.album.uri, false, position)
|
|
||||||
},
|
|
||||||
|
|
||||||
open_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<p class="heading has-text-centered-mobile"><a class="has-text-link" @click="open_artist">{{ artist.album_count }} albums</a> | {{ artist.track_count }} tracks</p>
|
<p class="heading has-text-centered-mobile"><a class="has-text-link" @click="open_artist">{{ artist.album_count }} albums</a> | {{ artist.track_count }} tracks</p>
|
||||||
<list-item-track v-for="(track, index) in tracks.items" :key="track.id" :track="track" @click="play_track(index)">
|
<list-tracks :tracks="tracks.items" :uris="track_uris"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
<modal-dialog-artist :show="show_artist_details_modal" :artist="artist" @close="show_artist_details_modal = false" />
|
<modal-dialog-artist :show="show_artist_details_modal" :artist="artist" @close="show_artist_details_modal = false" />
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
@ -37,8 +30,7 @@
|
|||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import IndexButtonList from '@/components/IndexButtonList'
|
import IndexButtonList from '@/components/IndexButtonList'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import ModalDialogArtist from '@/components/ModalDialogArtist'
|
import ModalDialogArtist from '@/components/ModalDialogArtist'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
@ -59,16 +51,13 @@ const tracksData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageArtistTracks',
|
name: 'PageArtistTracks',
|
||||||
mixins: [LoadDataBeforeEnterMixin(tracksData)],
|
mixins: [LoadDataBeforeEnterMixin(tracksData)],
|
||||||
components: { ContentWithHeading, ListItemTrack, IndexButtonList, ModalDialogTrack, ModalDialogArtist },
|
components: { ContentWithHeading, ListTracks, IndexButtonList, ModalDialogArtist },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
artist: {},
|
artist: {},
|
||||||
tracks: { items: [] },
|
tracks: { items: [] },
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {},
|
|
||||||
|
|
||||||
show_artist_details_modal: false
|
show_artist_details_modal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -77,6 +66,10 @@ export default {
|
|||||||
index_list () {
|
index_list () {
|
||||||
return [...new Set(this.tracks.items
|
return [...new Set(this.tracks.items
|
||||||
.map(track => track.title_sort.charAt(0).toUpperCase()))]
|
.map(track => track.title_sort.charAt(0).toUpperCase()))]
|
||||||
|
},
|
||||||
|
|
||||||
|
track_uris () {
|
||||||
|
return this.tracks.items.map(a => a.uri).join(',')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -88,15 +81,6 @@ export default {
|
|||||||
|
|
||||||
play: function () {
|
play: function () {
|
||||||
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), true)
|
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), true)
|
||||||
},
|
|
||||||
|
|
||||||
play_track: function (position) {
|
|
||||||
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), false, position)
|
|
||||||
},
|
|
||||||
|
|
||||||
open_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,14 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<p class="heading is-7 has-text-centered-mobile fd-has-margin-top">{{ album.track_count }} tracks</p>
|
<p class="heading is-7 has-text-centered-mobile fd-has-margin-top">{{ album.track_count }} tracks</p>
|
||||||
<list-item-track v-for="(track, index) in tracks" :key="track.id" :track="track" @click="play_track(index)">
|
<list-tracks :tracks="tracks" :uris="album.uri"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
<modal-dialog-album :show="show_album_details_modal" :album="album" :media_kind="'audiobook'" @close="show_album_details_modal = false" />
|
<modal-dialog-album :show="show_album_details_modal" :album="album" :media_kind="'audiobook'" @close="show_album_details_modal = false" />
|
||||||
</template>
|
</template>
|
||||||
</content-with-hero>
|
</content-with-hero>
|
||||||
@ -40,8 +33,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHero from '@/templates/ContentWithHero'
|
import ContentWithHero from '@/templates/ContentWithHero'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
|
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
|
||||||
import CoverArtwork from '@/components/CoverArtwork'
|
import CoverArtwork from '@/components/CoverArtwork'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
@ -63,16 +55,13 @@ const albumData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageAudiobooksAlbum',
|
name: 'PageAudiobooksAlbum',
|
||||||
mixins: [LoadDataBeforeEnterMixin(albumData)],
|
mixins: [LoadDataBeforeEnterMixin(albumData)],
|
||||||
components: { ContentWithHero, ListItemTrack, ModalDialogTrack, ModalDialogAlbum, CoverArtwork },
|
components: { ContentWithHero, ListTracks, ModalDialogAlbum, CoverArtwork },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
album: {},
|
album: {},
|
||||||
tracks: [],
|
tracks: [],
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {},
|
|
||||||
|
|
||||||
show_album_details_modal: false
|
show_album_details_modal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -27,14 +27,7 @@
|
|||||||
<p class="heading">tracks</p>
|
<p class="heading">tracks</p>
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<list-item-track v-for="track in recently_played.items" :key="track.id" :track="track" @click="play_track(track)">
|
<list-tracks :tracks="recently_played.items"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_track_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_track_details_modal" :track="selected_track" @close="show_track_details_modal = false" />
|
|
||||||
</template>
|
</template>
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<nav class="level">
|
<nav class="level">
|
||||||
@ -52,8 +45,7 @@ import { LoadDataBeforeEnterMixin } from './mixin'
|
|||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import TabsMusic from '@/components/TabsMusic'
|
import TabsMusic from '@/components/TabsMusic'
|
||||||
import ListAlbums from '@/components/ListAlbums'
|
import ListAlbums from '@/components/ListAlbums'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
const browseData = {
|
const browseData = {
|
||||||
@ -73,7 +65,7 @@ const browseData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageBrowse',
|
name: 'PageBrowse',
|
||||||
mixins: [LoadDataBeforeEnterMixin(browseData)],
|
mixins: [LoadDataBeforeEnterMixin(browseData)],
|
||||||
components: { ContentWithHeading, TabsMusic, ListAlbums, ListItemTrack, ModalDialogTrack },
|
components: { ContentWithHeading, TabsMusic, ListAlbums, ListTracks },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@ -88,15 +80,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
open_browse: function (type) {
|
open_browse: function (type) {
|
||||||
this.$router.push({ path: '/music/browse/' + type })
|
this.$router.push({ path: '/music/browse/' + type })
|
||||||
},
|
|
||||||
|
|
||||||
open_track_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_track_details_modal = true
|
|
||||||
},
|
|
||||||
|
|
||||||
play_track: function (track) {
|
|
||||||
webapi.player_play_uri(track.uri, false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,7 @@
|
|||||||
<p class="heading">tracks</p>
|
<p class="heading">tracks</p>
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<list-item-track v-for="track in recently_played.items" :key="track.id" :track="track" @click="play_track(track)">
|
<list-tracks :tracks="recently_played.items"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
</div>
|
</div>
|
||||||
@ -25,8 +18,7 @@
|
|||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import TabsMusic from '@/components/TabsMusic'
|
import TabsMusic from '@/components/TabsMusic'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
const browseData = {
|
const browseData = {
|
||||||
@ -46,25 +38,11 @@ const browseData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageBrowseType',
|
name: 'PageBrowseType',
|
||||||
mixins: [LoadDataBeforeEnterMixin(browseData)],
|
mixins: [LoadDataBeforeEnterMixin(browseData)],
|
||||||
components: { ContentWithHeading, TabsMusic, ListItemTrack, ModalDialogTrack },
|
components: { ContentWithHeading, TabsMusic, ListTracks },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
recently_played: {},
|
recently_played: {}
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
open_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_details_modal = true
|
|
||||||
},
|
|
||||||
|
|
||||||
play_track: function (track) {
|
|
||||||
webapi.player_play_uri(track.uri, false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<p class="heading has-text-centered-mobile"><a class="has-text-link" @click="open_genre">albums</a> | {{ tracks.total }} tracks</p>
|
<p class="heading has-text-centered-mobile"><a class="has-text-link" @click="open_genre">albums</a> | {{ tracks.total }} tracks</p>
|
||||||
<list-item-track v-for="(track, index) in tracks.items" :key="track.id" :track="track" @click="play_track(index)">
|
<list-tracks :tracks="tracks.items" :expression="expression"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
<modal-dialog-genre :show="show_genre_details_modal" :genre="{ 'name': genre }" @close="show_genre_details_modal = false" />
|
<modal-dialog-genre :show="show_genre_details_modal" :genre="{ 'name': genre }" @close="show_genre_details_modal = false" />
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
@ -37,8 +30,7 @@
|
|||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import IndexButtonList from '@/components/IndexButtonList'
|
import IndexButtonList from '@/components/IndexButtonList'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import ModalDialogGenre from '@/components/ModalDialogGenre'
|
import ModalDialogGenre from '@/components/ModalDialogGenre'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
@ -56,16 +48,13 @@ const tracksData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageGenreTracks',
|
name: 'PageGenreTracks',
|
||||||
mixins: [LoadDataBeforeEnterMixin(tracksData)],
|
mixins: [LoadDataBeforeEnterMixin(tracksData)],
|
||||||
components: { ContentWithHeading, ListItemTrack, IndexButtonList, ModalDialogTrack, ModalDialogGenre },
|
components: { ContentWithHeading, ListTracks, IndexButtonList, ModalDialogGenre },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
tracks: { items: [] },
|
tracks: { items: [] },
|
||||||
genre: '',
|
genre: '',
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {},
|
|
||||||
|
|
||||||
show_genre_details_modal: false
|
show_genre_details_modal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -74,6 +63,10 @@ export default {
|
|||||||
index_list () {
|
index_list () {
|
||||||
return [...new Set(this.tracks.items
|
return [...new Set(this.tracks.items
|
||||||
.map(track => track.title_sort.charAt(0).toUpperCase()))]
|
.map(track => track.title_sort.charAt(0).toUpperCase()))]
|
||||||
|
},
|
||||||
|
|
||||||
|
expression () {
|
||||||
|
return 'genre is "' + this.genre + '" and media_kind is music'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -84,16 +77,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
play: function () {
|
play: function () {
|
||||||
webapi.player_play_expression('genre is "' + this.genre + '" and media_kind is music', true)
|
webapi.player_play_expression(this.expression, true)
|
||||||
},
|
|
||||||
|
|
||||||
play_track: function (position) {
|
|
||||||
webapi.player_play_expression('genre is "' + this.genre + '" and media_kind is music', false, position)
|
|
||||||
},
|
|
||||||
|
|
||||||
open_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<p class="heading has-text-centered-mobile">{{ tracks.length }} tracks</p>
|
<p class="heading has-text-centered-mobile">{{ tracks.length }} tracks</p>
|
||||||
<list-item-track v-for="(track, index) in tracks" :key="track.id" :track="track" @click="play_track(index)">
|
<list-tracks :tracks="tracks" :uris="uris"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
<modal-dialog-playlist :show="show_playlist_details_modal" :playlist="playlist" :tracks="playlist.random ? tracks : undefined" @close="show_playlist_details_modal = false" />
|
<modal-dialog-playlist :show="show_playlist_details_modal" :playlist="playlist" :tracks="playlist.random ? tracks : undefined" @close="show_playlist_details_modal = false" />
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
@ -31,8 +24,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist'
|
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
@ -53,40 +45,29 @@ const playlistData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PagePlaylist',
|
name: 'PagePlaylist',
|
||||||
mixins: [LoadDataBeforeEnterMixin(playlistData)],
|
mixins: [LoadDataBeforeEnterMixin(playlistData)],
|
||||||
components: { ContentWithHeading, ListItemTrack, ModalDialogTrack, ModalDialogPlaylist },
|
components: { ContentWithHeading, ListTracks, ModalDialogPlaylist },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
playlist: {},
|
playlist: {},
|
||||||
tracks: [],
|
tracks: [],
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {},
|
|
||||||
|
|
||||||
show_playlist_details_modal: false
|
show_playlist_details_modal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
uris () {
|
||||||
|
if (this.playlist.random) {
|
||||||
|
return this.tracks.map(a => a.uri).join(',')
|
||||||
|
}
|
||||||
|
return this.playlist.uri
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
play: function () {
|
play: function () {
|
||||||
if (this.playlist.random) {
|
webapi.player_play_uri(this.uris, true)
|
||||||
webapi.player_play_uri(this.tracks.map(a => a.uri).join(','), true)
|
|
||||||
} else {
|
|
||||||
webapi.player_play_uri(this.playlist.uri, true)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
play_track: function (position) {
|
|
||||||
if (this.playlist.random) {
|
|
||||||
webapi.player_play_uri(this.tracks.map(a => a.uri).join(','), false, position)
|
|
||||||
} else {
|
|
||||||
webapi.player_play_uri(this.playlist.uri, false, position)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
open_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,19 +5,7 @@
|
|||||||
<p class="heading">{{ playlists.total }} playlists</p>
|
<p class="heading">{{ playlists.total }} playlists</p>
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<list-item-playlist v-for="playlist in playlists.items" :key="playlist.id" :playlist="playlist" @click="open_playlist(playlist)">
|
<list-playlists :playlists="playlists.items"></list-playlists>
|
||||||
<template slot="icon">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="mdi" :class="{ 'mdi-library-music': playlist.type !== 'folder', 'mdi-rss': playlist.type === 'rss', 'mdi-folder': playlist.type === 'folder' }"></i>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(playlist)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-playlist>
|
|
||||||
<modal-dialog-playlist :show="show_details_modal" :playlist="selected_playlist" @close="show_details_modal = false" />
|
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
</template>
|
</template>
|
||||||
@ -25,8 +13,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import ListItemPlaylist from '@/components/ListItemPlaylist'
|
import ListPlaylists from '@/components/ListPlaylists'
|
||||||
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist'
|
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
const playlistsData = {
|
const playlistsData = {
|
||||||
@ -46,30 +33,12 @@ const playlistsData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PagePlaylists',
|
name: 'PagePlaylists',
|
||||||
mixins: [LoadDataBeforeEnterMixin(playlistsData)],
|
mixins: [LoadDataBeforeEnterMixin(playlistsData)],
|
||||||
components: { ContentWithHeading, ListItemPlaylist, ModalDialogPlaylist },
|
components: { ContentWithHeading, ListPlaylists },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
playlist: {},
|
playlist: {},
|
||||||
playlists: {},
|
playlists: {}
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_playlist: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
open_playlist: function (playlist) {
|
|
||||||
if (playlist.type !== 'folder') {
|
|
||||||
this.$router.push({ path: '/playlists/' + playlist.id + '/tracks' })
|
|
||||||
} else {
|
|
||||||
this.$router.push({ path: '/playlists/' + playlist.id })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
open_dialog: function (playlist) {
|
|
||||||
this.selected_playlist = playlist
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<p class="heading has-text-centered-mobile">{{ tracks.total }} tracks</p>
|
<p class="heading has-text-centered-mobile">{{ tracks.total }} tracks</p>
|
||||||
<list-item-track v-for="track in tracks.items" :key="track.id" :track="track" @click="play_track(track)">
|
<list-tracks :tracks="tracks.items"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
|
||||||
</template>
|
</template>
|
||||||
</content-with-heading>
|
</content-with-heading>
|
||||||
</div>
|
</div>
|
||||||
@ -22,8 +15,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { LoadDataBeforeEnterMixin } from './mixin'
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
const streamsData = {
|
const streamsData = {
|
||||||
@ -39,25 +31,11 @@ const streamsData = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'PageRadioStreams',
|
name: 'PageRadioStreams',
|
||||||
mixins: [LoadDataBeforeEnterMixin(streamsData)],
|
mixins: [LoadDataBeforeEnterMixin(streamsData)],
|
||||||
components: { ContentWithHeading, ListItemTrack, ModalDialogTrack },
|
components: { ContentWithHeading, ListTracks },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
tracks: { items: [] },
|
tracks: { items: [] }
|
||||||
|
|
||||||
show_details_modal: false,
|
|
||||||
selected_track: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
play_track: function (track) {
|
|
||||||
webapi.player_play_uri(track.uri, false)
|
|
||||||
},
|
|
||||||
|
|
||||||
open_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_details_modal = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,14 +34,7 @@
|
|||||||
<p class="title is-4">Tracks</p>
|
<p class="title is-4">Tracks</p>
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<list-item-track v-for="track in tracks.items" :key="track.id" :track="track" @click="play_track(track)">
|
<list-tracks :tracks="tracks.items"></list-tracks>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_track_dialog(track)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-track>
|
|
||||||
<modal-dialog-track :show="show_track_details_modal" :track="selected_track" @close="show_track_details_modal = false" />
|
|
||||||
</template>
|
</template>
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<nav v-if="show_all_tracks_button" class="level">
|
<nav v-if="show_all_tracks_button" class="level">
|
||||||
@ -95,14 +88,7 @@
|
|||||||
<p class="title is-4">Playlists</p>
|
<p class="title is-4">Playlists</p>
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<list-item-playlist v-for="playlist in playlists.items" :key="playlist.id" :playlist="playlist" @click="open_playlist(playlist)">
|
<list-playlists :playlists="playlists.items"></list-playlists>
|
||||||
<template slot="actions">
|
|
||||||
<a @click="open_playlist_dialog(playlist)">
|
|
||||||
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</list-item-playlist>
|
|
||||||
<modal-dialog-playlist :show="show_playlist_details_modal" :playlist="selected_playlist" @close="show_playlist_details_modal = false" />
|
|
||||||
</template>
|
</template>
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<nav v-if="show_all_playlists_button" class="level">
|
<nav v-if="show_all_playlists_button" class="level">
|
||||||
@ -155,18 +141,16 @@
|
|||||||
<script>
|
<script>
|
||||||
import ContentWithHeading from '@/templates/ContentWithHeading'
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
||||||
import TabsSearch from '@/components/TabsSearch'
|
import TabsSearch from '@/components/TabsSearch'
|
||||||
import ListItemTrack from '@/components/ListItemTrack'
|
import ListTracks from '@/components/ListTracks'
|
||||||
import ListArtists from '@/components/ListArtists'
|
import ListArtists from '@/components/ListArtists'
|
||||||
import ListAlbums from '@/components/ListAlbums'
|
import ListAlbums from '@/components/ListAlbums'
|
||||||
import ListItemPlaylist from '@/components/ListItemPlaylist'
|
import ListPlaylists from '@/components/ListPlaylists'
|
||||||
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
|
||||||
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist'
|
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
import * as types from '@/store/mutation_types'
|
import * as types from '@/store/mutation_types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PageSearch',
|
name: 'PageSearch',
|
||||||
components: { ContentWithHeading, TabsSearch, ListItemTrack, ListArtists, ListAlbums, ListItemPlaylist, ModalDialogTrack, ModalDialogPlaylist },
|
components: { ContentWithHeading, TabsSearch, ListTracks, ListArtists, ListAlbums, ListPlaylists },
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@ -177,13 +161,7 @@ export default {
|
|||||||
albums: { items: [], total: 0 },
|
albums: { items: [], total: 0 },
|
||||||
playlists: { items: [], total: 0 },
|
playlists: { items: [], total: 0 },
|
||||||
audiobooks: { items: [], total: 0 },
|
audiobooks: { items: [], total: 0 },
|
||||||
podcasts: { items: [], total: 0 },
|
podcasts: { items: [], total: 0 }
|
||||||
|
|
||||||
show_track_details_modal: false,
|
|
||||||
selected_track: {},
|
|
||||||
|
|
||||||
show_playlist_details_modal: false,
|
|
||||||
selected_playlist: {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -411,27 +389,9 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
play_track: function (track) {
|
|
||||||
webapi.player_play_uri(track.uri, false)
|
|
||||||
},
|
|
||||||
|
|
||||||
open_playlist: function (playlist) {
|
|
||||||
this.$router.push({ path: '/playlists/' + playlist.id + '/tracks' })
|
|
||||||
},
|
|
||||||
|
|
||||||
open_recent_search: function (query) {
|
open_recent_search: function (query) {
|
||||||
this.search_query = query
|
this.search_query = query
|
||||||
this.new_search()
|
this.new_search()
|
||||||
},
|
|
||||||
|
|
||||||
open_track_dialog: function (track) {
|
|
||||||
this.selected_track = track
|
|
||||||
this.show_track_details_modal = true
|
|
||||||
},
|
|
||||||
|
|
||||||
open_playlist_dialog: function (playlist) {
|
|
||||||
this.selected_playlist = playlist
|
|
||||||
this.show_playlist_details_modal = true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user