From 8621d06fbc9ba6d3951f4d774465223df20499d8 Mon Sep 17 00:00:00 2001 From: Thomas Amland Date: Mon, 12 Oct 2020 19:06:36 +0200 Subject: [PATCH] add scan button --- src/app/TopNav.vue | 6 ++++++ src/shared/api.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/app/TopNav.vue b/src/app/TopNav.vue index 1d4f374..80b6d77 100644 --- a/src/app/TopNav.vue +++ b/src/app/TopNav.vue @@ -25,6 +25,9 @@ Server settings + + Scan media folders + About @@ -63,6 +66,9 @@ ...mapActions([ 'showMenu', ]), + scan() { + this.$api.scan() + }, logout() { this.$auth.logout() this.$router.go(0) diff --git a/src/shared/api.ts b/src/shared/api.ts index e4191f9..8c68e58 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -308,6 +308,10 @@ export class API { return this.get('rest/deleteInternetRadioStation', { id }) } + async scan(): Promise { + return this.get('rest/startScan') + } + private normalizeRadioStation(item: any): Track & RadioStation { return { id: `radio-${item.id}`,