add scan button

This commit is contained in:
Thomas Amland 2020-10-12 19:06:36 +02:00
parent cab0adb392
commit 8621d06fbc
2 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,9 @@
<b-dropdown-item :href="`${server}/settings.view`"> <b-dropdown-item :href="`${server}/settings.view`">
Server settings Server settings
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item-button @click="scan">
Scan media folders
</b-dropdown-item-button>
<b-dropdown-item-button @click="showAboutModal = true"> <b-dropdown-item-button @click="showAboutModal = true">
About About
</b-dropdown-item-button> </b-dropdown-item-button>
@ -63,6 +66,9 @@
...mapActions([ ...mapActions([
'showMenu', 'showMenu',
]), ]),
scan() {
this.$api.scan()
},
logout() { logout() {
this.$auth.logout() this.$auth.logout()
this.$router.go(0) this.$router.go(0)

View File

@ -308,6 +308,10 @@ export class API {
return this.get('rest/deleteInternetRadioStation', { id }) return this.get('rest/deleteInternetRadioStation', { id })
} }
async scan(): Promise<void> {
return this.get('rest/startScan')
}
private normalizeRadioStation(item: any): Track & RadioStation { private normalizeRadioStation(item: any): Track & RadioStation {
return { return {
id: `radio-${item.id}`, id: `radio-${item.id}`,