diff options
| author | Hellyson Rodrigo Parteka <[email protected]> | 2021-09-23 00:41:26 -0300 |
|---|---|---|
| committer | Hellyson Rodrigo Parteka <[email protected]> | 2021-09-23 00:41:26 -0300 |
| commit | 3f210c53f4ba310bf971e80825935067b29b99b4 (patch) | |
| tree | 76d99673f928356e4b4b4999bae7cba74e6a7d30 /src | |
| parent | b5bb465cdc0d33a46ec85fe6f33193545032b444 (diff) | |
| download | muse-3f210c53f4ba310bf971e80825935067b29b99b4.tar.xz muse-3f210c53f4ba310bf971e80825935067b29b99b4.zip | |
fix: playlist load, cache key
Fixes #357
Diffstat (limited to 'src')
| -rw-r--r-- | src/services/get-songs.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/services/get-songs.ts b/src/services/get-songs.ts index a624d54..ba4401c 100644 --- a/src/services/get-songs.ts +++ b/src/services/get-songs.ts @@ -139,18 +139,20 @@ export default class { // Start fetching extra details about videos videoDetailsPromises.push((async () => { // Unfortunately, package doesn't provide a method for this + const p = { + searchParams: { + part: 'contentDetails', + id: items.map(item => item.contentDetails.videoId).join(','), + key: this.youtubeKey, + responseType: 'json', + }, + }; const {items: videoDetailItems} = await this.cache.wrap( async () => got( 'https://www.googleapis.com/youtube/v3/videos', - { - searchParams: { - part: 'contentDetails', - id: items.map(item => item.contentDetails.videoId).join(','), - key: this.youtubeKey, - responseType: 'json', - }, - }, + p, ).json() as Promise<{items: VideoDetailsResponse[]}>, + p, { expiresIn: ONE_MINUTE_IN_SECONDS, }, |
