From ab8cb98e8223bff42b33cda5845ff07aab490486 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Wed, 23 Dec 2020 02:40:58 +0100 Subject: [PATCH] feat(card): add library scan progress indicator --- components/Item/Card.vue | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/components/Item/Card.vue b/components/Item/Card.vue index 7b45016c..be9ed19b 100644 --- a/components/Item/Card.vue +++ b/components/Item/Card.vue @@ -13,6 +13,13 @@ class="card-image" @error="imageLoadError = true" /> + mdi-play - +
@@ -124,7 +131,8 @@ export default Vue.extend({ }, data() { return { - imageLoadError: false + imageLoadError: false, + refreshProgress: 0 }; }, computed: { @@ -240,6 +248,17 @@ export default Vue.extend({ } } }, + created() { + this.$store.subscribe((mutation, state) => { + if ( + mutation.type === 'SOCKET_ONMESSAGE' && + state.socket.message.MessageType === 'RefreshProgress' && + state.socket.message.Data.ItemId === this.item.Id + ) { + this.refreshProgress = state.socket.message.Data.Progress; + } + }); + }, methods: { ...mapActions('playbackManager', ['play']) }