diff options
| author | Max Isom <[email protected]> | 2021-09-23 13:06:01 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-23 13:06:01 -0400 |
| commit | a8676e6ebd8a11d114393dbd4993a574d61c6b55 (patch) | |
| tree | 76d99673f928356e4b4b4999bae7cba74e6a7d30 /src | |
| parent | b5bb465cdc0d33a46ec85fe6f33193545032b444 (diff) | |
| parent | 3f210c53f4ba310bf971e80825935067b29b99b4 (diff) | |
| download | muse-a8676e6ebd8a11d114393dbd4993a574d61c6b55.tar.xz muse-a8676e6ebd8a11d114393dbd4993a574d61c6b55.zip | |
Merge pull request #358 from Hellysonrp/fix-playlist-load
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, }, |
