Added update checker

This commit is contained in:
RemixDev
2022-01-13 01:33:29 +01:00
parent 018b008915
commit b9e2fd298e
9 changed files with 152 additions and 71 deletions

View File

@@ -0,0 +1,16 @@
import { ApiHandler } from '../../../types'
import { getLatestVersion, isUpdateAvailable } from '../../../main'
const path: ApiHandler['path'] = '/checkForUpdates'
const handler: ApiHandler['handler'] = async (_, res) => {
const latestCommit = await getLatestVersion()
res.send({
latestCommit,
updateAvailable: isUpdateAvailable()
})
}
const apiHandler: ApiHandler = { path, handler }
export default apiHandler

View File

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