[web-src] forced meta rescan

This commit is contained in:
whatdoineed2do/Ray 2019-06-09 15:19:52 +01:00 committed by ejurgensen
parent e9c1a59ad2
commit bf7c96d23f
4 changed files with 17 additions and 1 deletions

View File

@ -97,6 +97,8 @@
<div class="column is-7 content">
<a class="button" v-on:click="update" v-show="!library.updating">Update library</a>
<p v-show="library.updating">Update in progress ...</p>
<a class="button" v-on:click="update_meta" v-show="!library.updating">Rescan library meta</a>
<p v-show="library.updating">Rescan in progress ...</p>
</div>
</div>

View File

@ -56,6 +56,11 @@ var app = new Vue({
axios.get('/api/update').then(console.log('Library is updating'));
},
update_meta: function() {
this.library.updating = true;
axios.get('/api/update/meta').then(console.log('Library is rescanning meta'));
},
kickoffPairing: function() {
axios.post('/api/pairing', this.pairing_req).then(response => {
console.log('Kicked off pairing');

View File

@ -24,8 +24,9 @@
</div>
<!-- Right side -->
<div class="level-right">
<div class="level-right buttons">
<a class="button is-small is-outlined is-link" :class="{ 'is-loading': library.updating }" @click="update">Update</a>
<a class="button is-small is-outlined is-link" :class="{ 'is-loading': library.updating }" @click="update_meta">Force Meta Rescan</a>
</div>
</nav>
@ -95,6 +96,10 @@ export default {
methods: {
update: function () {
webapi.library_update()
},
update_meta: function () {
webapi.library_update_meta()
}
},

View File

@ -21,6 +21,10 @@ export default {
return axios.get('/api/update')
},
library_update_meta () {
return axios.get('/api/update/meta')
},
library_count (expression) {
return axios.get('/api/library/count?expression=' + expression)
},