Skip to content

Commit

Permalink
[web-src] handle usermark in all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
whatdoineed2do/Ray committed Sep 29, 2021
1 parent b0d89dd commit aba39bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion web-src/src/pages/PageArtistTracks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
</template>
<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>
<list-tracks :tracks="tracks.items" :uris="track_uris"></list-tracks>
<list-tracks :tracks="tracks.items" :uris="track_uris" @usermark-updated="usermark_upd"></list-tracks>
<modal-dialog-artist :show="show_artist_details_modal" :artist="artist" @close="show_artist_details_modal = false" />
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
</template>
</content-with-heading>
</div>
Expand Down Expand Up @@ -79,6 +80,10 @@ export default {
this.$router.push({ path: '/music/artists/' + this.artist.id })
},
usermark_upd: function (args) {
this.tracks.items.find(e => e.id === args.track_id).usermark = args.value
},
play: function () {
webapi.player_play_uri(this.tracks.items.map(a => a.uri).join(','), true)
}
Expand Down
6 changes: 5 additions & 1 deletion web-src/src/pages/PageBrowse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<p class="heading">tracks</p>
</template>
<template slot="content">
<list-tracks :tracks="recently_played.items"></list-tracks>
<list-tracks :tracks="recently_played.items" @usermark-updated="usermark_upd_played"></list-tracks>
</template>
<template slot="footer">
<nav class="level">
Expand Down Expand Up @@ -80,6 +80,10 @@ export default {
methods: {
open_browse: function (type) {
this.$router.push({ path: '/music/browse/' + type })
},
usermark_upd_played: function (args) {
this.recently_played.items.find(e => e.id === args.track_id).usermark = args.value
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion web-src/src/pages/PageSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<p class="title is-4">Tracks</p>
</template>
<template slot="content">
<list-tracks :tracks="tracks.items"></list-tracks>
<list-tracks :tracks="tracks.items" @usermark-updated="usermark_upd"></list-tracks>
</template>
<template slot="footer">
<nav v-if="show_all_tracks_button" class="level">
Expand Down Expand Up @@ -355,6 +355,10 @@ export default {
this.$refs.search_field.blur()
},
usermark_upd: function (args) {
this.tracks.items.find(e => e.id === args.track_id).usermark = args.value
},
open_search_tracks: function () {
this.$router.push({
path: '/search/library',
Expand Down

0 comments on commit aba39bc

Please sign in to comment.