mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-21 11:05:40 -05:00
bug fix for tidal account checker
This commit is contained in:
@@ -42,6 +42,8 @@ interface LoginData {
|
|||||||
interface SessionData {
|
interface SessionData {
|
||||||
countryCode: string
|
countryCode: string
|
||||||
userId: number
|
userId: number
|
||||||
|
status?: number
|
||||||
|
userMessage?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SubscriptionData {
|
interface SubscriptionData {
|
||||||
@@ -419,7 +421,16 @@ export default class Tidal implements Streamer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async getAccountInfo(): Promise<StreamerAccount> {
|
async getAccountInfo(): Promise<StreamerAccount> {
|
||||||
if (!this.userId) await this.getCountryCode()
|
if (this.userId == undefined || this.countryCode == undefined) {
|
||||||
|
if (Date.now() > this.expires) await this.refresh()
|
||||||
|
const sessionResponse = await fetch('https://api.tidal.com/v1/sessions', {
|
||||||
|
headers: this.headers()
|
||||||
|
})
|
||||||
|
const sessionData = <SessionData>await sessionResponse.json()
|
||||||
|
|
||||||
|
this.userId = sessionData.userId
|
||||||
|
this.countryCode = sessionData.countryCode
|
||||||
|
}
|
||||||
const subscription = <SubscriptionData>(
|
const subscription = <SubscriptionData>(
|
||||||
await this.#get(`users/${this.userId}/subscription`, {}, TIDAL_SUBSCRIPTION_BASE)
|
await this.#get(`users/${this.userId}/subscription`, {}, TIDAL_SUBSCRIPTION_BASE)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user