mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-17 09:07:28 -05:00
lol
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lucida",
|
"name": "lucida",
|
||||||
"version": "1.1.4",
|
"version": "1.1.5",
|
||||||
"description": "A modular downloader tool",
|
"description": "A modular downloader tool",
|
||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -47,12 +47,12 @@ class Lucida {
|
|||||||
}
|
}
|
||||||
throw new Error(`Couldn't find module for hostname ${urlObj.hostname}`)
|
throw new Error(`Couldn't find module for hostname ${urlObj.hostname}`)
|
||||||
}
|
}
|
||||||
getByUrl(url: string): Promise<GetByUrlResponse> {
|
getByUrl(url: string, limit?: number): Promise<GetByUrlResponse> {
|
||||||
const urlObj = new URL(url)
|
const urlObj = new URL(url)
|
||||||
for (const i in this.modules) {
|
for (const i in this.modules) {
|
||||||
const matches = this.modules[i].hostnames.includes(urlObj.hostname)
|
const matches = this.modules[i].hostnames.includes(urlObj.hostname)
|
||||||
if (!matches) continue
|
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}`)
|
throw new Error(`Couldn't find module for hostname ${urlObj.hostname}`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,8 +84,10 @@ export interface AlbumGetByUrlResponse {
|
|||||||
export interface Streamer {
|
export interface Streamer {
|
||||||
hostnames: string[]
|
hostnames: string[]
|
||||||
search(query: string, limit: number): Promise<SearchResults>
|
search(query: string, limit: number): Promise<SearchResults>
|
||||||
getTypeFromUrl: ((url: string) => ItemType) | ((url: string, limit?: number) => ItemType)
|
getTypeFromUrl(url: string): ItemType
|
||||||
getByUrl(url: string): Promise<GetByUrlResponse>
|
getByUrl:
|
||||||
|
| ((url: string) => Promise<GetByUrlResponse>)
|
||||||
|
| ((url: string, limit?: number) => Promise<GetByUrlResponse>)
|
||||||
disconnect?(): Promise<void>
|
disconnect?(): Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user