Connect Athena to Spotify

This commit is contained in:
2022-01-15 19:35:43 +01:00
parent f6070b20ee
commit 240fcbac90
23 changed files with 684 additions and 99 deletions

View File

@@ -0,0 +1,16 @@
import Logger from '@ioc:Adonis/Core/Logger'
import { getCurrentPlayingFromSpotify } from 'App/Utils/SongUtils'
const MS = 1000
let taskId
export async function Activate(): Promise<void> {
Logger.info(`Starting task runner for watching spotify current playing [${MS} ms]`)
await getCurrentPlayingFromSpotify()
taskId = setInterval(getCurrentPlayingFromSpotify, MS)
}
export function ShutDown(): void {
clearInterval(taskId)
Logger.info('Shutdown task runner for getting current developing state')
}