feat(server): added spotifyStatus endpoint to get spotify plugin status; feat(server): added plugin information on connect endpoint

This commit is contained in:
Roberto Tonino
2021-08-11 15:25:02 +02:00
parent 94f79b4a8c
commit 43568713b6
3 changed files with 18 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ import getUserPlaylists from './getUserPlaylists'
import getUserSpotifyPlaylists from './getUserSpotifyPlaylists'
import getUserFavorites from './getUserFavorites'
import getQueue from './getQueue'
import spotifyStatus from './spotifyStatus'
export default [
albumSearch,
@@ -35,5 +36,6 @@ export default [
getUserPlaylists,
getUserSpotifyPlaylists,
getUserFavorites,
getQueue
getQueue,
spotifyStatus
]

View File

@@ -0,0 +1,12 @@
import { ApiHandler } from '../../../types'
import { plugins } from '../../../main'
const path: ApiHandler['path'] = '/spotifyStatus'
const handler: ApiHandler['handler'] = (_, res) => {
res.send({ spotifyEnabled: plugins.spotify.enabled })
}
const apiHandler: ApiHandler = { path, handler }
export default apiHandler