Simplify code

This commit is contained in:
Thongrapee Panyapatiphan 2021-10-01 22:15:34 +07:00
parent 56a899250e
commit 11eba5746d
No known key found for this signature in database
GPG key ID: 4B08AEC7F50F1967

View file

@ -126,7 +126,7 @@ export default class {
const {items, nextPageToken} = await this.cache.wrap( const {items, nextPageToken} = await this.cache.wrap(
this.youtube.playlists.items, this.youtube.playlists.items,
listId, listId,
{maxResults: `${limit}`, pageToken: nextToken}, {maxResults: limit, pageToken: nextToken},
{ {
expiresIn: ONE_MINUTE_IN_SECONDS, expiresIn: ONE_MINUTE_IN_SECONDS,
}, },
@ -219,7 +219,7 @@ export default class {
while (tracksResponse.next) { while (tracksResponse.next) {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
({body: tracksResponse} = await this.spotify.getPlaylistTracks(uri.id, { ({body: tracksResponse} = await this.spotify.getPlaylistTracks(uri.id, {
limit: parseInt(new URL(tracksResponse.next).searchParams.get('limit') ?? `${limit}`, 10), limit,
offset: parseInt(new URL(tracksResponse.next).searchParams.get('offset') ?? '0', 10), offset: parseInt(new URL(tracksResponse.next).searchParams.get('offset') ?? '0', 10),
})); }));