diff options
| author | Max Isom <[email protected]> | 2021-09-19 22:04:34 -0400 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2021-09-19 22:09:09 -0400 |
| commit | fd782219eff8016a00e87f0c8e44af3a3ba74be6 (patch) | |
| tree | 2de37667318794427406b45848a7bf699c9e1a6f /src/services/third-party.ts | |
| parent | efcdeb78c8b690bc544dac1ed0be96a6693bcff6 (diff) | |
| download | muse-fd782219eff8016a00e87f0c8e44af3a3ba74be6.tar.xz muse-fd782219eff8016a00e87f0c8e44af3a3ba74be6.zip | |
Move to ESM, use ytsr, implement caching
Closes #315
Diffstat (limited to 'src/services/third-party.ts')
| -rw-r--r-- | src/services/third-party.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/services/third-party.ts b/src/services/third-party.ts index 00b9269..7958438 100644 --- a/src/services/third-party.ts +++ b/src/services/third-party.ts @@ -1,8 +1,8 @@ import {inject, injectable} from 'inversify'; import SpotifyWebApi from 'spotify-web-api-node'; -import Youtube from 'youtube.ts'; -import {TYPES} from '../types'; -import Config from './config'; +import Youtube from 'youtube.ts/dist/youtube.js'; +import {TYPES} from '../types.js'; +import Config from './config.js'; @injectable() export default class ThirdParty { @@ -12,7 +12,8 @@ export default class ThirdParty { private spotifyTokenTimerId?: NodeJS.Timeout; constructor(@inject(TYPES.Config) config: Config) { - this.youtube = new Youtube(config.YOUTUBE_API_KEY); + // Library is transpiled incorrectly + this.youtube = new ((Youtube as any).default)(config.YOUTUBE_API_KEY); this.spotify = new SpotifyWebApi({ clientId: config.SPOTIFY_CLIENT_ID, clientSecret: config.SPOTIFY_CLIENT_SECRET |
