add spotify support

This commit is contained in:
hazycora
2023-09-16 23:39:32 -04:00
parent 8af3b9f926
commit c321cfab05
7 changed files with 294 additions and 2 deletions

View File

@@ -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