mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-12 14:47:24 -05:00
add spotify support
This commit is contained in:
@@ -25,7 +25,7 @@ class Lucida {
|
||||
if (!this.logins) throw new Error('No logins specified')
|
||||
for (const i in this.logins) {
|
||||
const credentials = this.logins[i]
|
||||
await this.modules[i].login?.(credentials.username, credentials.password)
|
||||
await this.modules[i]?.login?.(credentials.username, credentials.password)
|
||||
}
|
||||
}
|
||||
async search(query: string, limit: number): Promise<{ [key: string]: SearchResults }> {
|
||||
@@ -53,6 +53,13 @@ class Lucida {
|
||||
}
|
||||
throw new Error(`Couldn't find module for hostname ${urlObj.hostname}`)
|
||||
}
|
||||
disconnect() {
|
||||
return Promise.all(
|
||||
Object.values(this.modules).map((e) => {
|
||||
return e.disconnect?.()
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Lucida
|
||||
|
||||
Reference in New Issue
Block a user