From 19626922dbe8d3b987eb57cae2fabc9acc27e08f Mon Sep 17 00:00:00 2001 From: hazycora Date: Sun, 17 Sep 2023 07:52:34 -0500 Subject: [PATCH] lol --- package.json | 2 +- src/index.ts | 4 ++-- src/types.ts | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 13dad4b..4bf849d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lucida", - "version": "1.1.4", + "version": "1.1.5", "description": "A modular downloader tool", "main": "build/index.js", "type": "module", diff --git a/src/index.ts b/src/index.ts index 398c949..1f27868 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,12 +47,12 @@ class Lucida { } throw new Error(`Couldn't find module for hostname ${urlObj.hostname}`) } - getByUrl(url: string): Promise { + getByUrl(url: string, limit?: number): Promise { const urlObj = new URL(url) for (const i in this.modules) { const matches = this.modules[i].hostnames.includes(urlObj.hostname) if (!matches) continue - return this.modules[i].getByUrl(url) + return this.modules[i].getByUrl(url, limit) } throw new Error(`Couldn't find module for hostname ${urlObj.hostname}`) } diff --git a/src/types.ts b/src/types.ts index 6975839..2c02b69 100644 --- a/src/types.ts +++ b/src/types.ts @@ -84,8 +84,10 @@ export interface AlbumGetByUrlResponse { export interface Streamer { hostnames: string[] search(query: string, limit: number): Promise - getTypeFromUrl: ((url: string) => ItemType) | ((url: string, limit?: number) => ItemType) - getByUrl(url: string): Promise + getTypeFromUrl(url: string): ItemType + getByUrl: + | ((url: string) => Promise) + | ((url: string, limit?: number) => Promise) disconnect?(): Promise }