Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
feat: change default pagination limit to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
vaaski committed Feb 19, 2021
1 parent ec688c4 commit 2780ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
import ky from "ky-universal"
import {
APIv2,
defaultLimit,
getClientIDv2,
PaginatedResponse,
paginateNext,
Expand Down Expand Up @@ -104,7 +105,7 @@ user.likes = async (identifier: URLorID, { limit = 50, client_id }: PaginatedOpt
*/
user.tracks = async (
identifier: URLorID,
{ limit = 50, client_id }: PaginatedOptions = {}
{ limit = defaultLimit, client_id }: PaginatedOptions = {}
) => {
if (typeof identifier === "string") identifier = (await resolve(identifier)).id
if (!client_id) client_id = await getClientIDv2()
Expand Down
1 change: 1 addition & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const issueURL = "https://github.com/cloudr-app/opensoundcloud/issues/new
export const scrapeURL = "https://soundcloud.com"
export const APIv1 = "https://api.soundcloud.com"
export const APIv2 = "https://api-v2.soundcloud.com"
export const defaultLimit = 20
export const urlify = (url: string, base = scrapeURL): string => {
return new URL(url, base).toString()
}
Expand Down

0 comments on commit 2780ad8

Please sign in to comment.