diff --git a/js/HiFi.ts b/js/HiFi.ts index b911642..b7cc551 100644 --- a/js/HiFi.ts +++ b/js/HiFi.ts @@ -1590,10 +1590,10 @@ class HiFiClient { const attr = inc.attributes ?? ({} as JsonApiIncludeAttributes); let pic_id: string | null = null; - const art_data = inc.relationships?.profileArt?.data; - if (Array.isArray(art_data) && art_data.length > 0) { - const artwork = artworks_map[art_data[0].id]; - const art_refs_artist = (() => { const d = inc.relationships?.profileArt?.data; return Array.isArray(d) ? d : d ? [d as JsonApiRef] : []; })(); + const art_refs_artist = (() => { + const d = inc.relationships?.profileArt?.data; + return Array.isArray(d) ? d : d ? [d as JsonApiRef] : []; + })(); if (art_refs_artist.length > 0) { const artwork = artworks_map[art_refs_artist[0].id]; const files = artwork?.attributes?.files; diff --git a/js/HiFi.ts.rej b/js/HiFi.ts.rej deleted file mode 100644 index 107cadd..0000000 --- a/js/HiFi.ts.rej +++ /dev/null @@ -1,53 +0,0 @@ -@@ -2097,45 +2185,46 @@ - offset, - countryCode: this.#countryCode, - }, - signal, - openApiToken - ); -- return HiFiClient.#jsonResponse({ version: HiFiClient.API_VERSION, data: fallback }); -+ return HiFiClient.#jsonResponse({ version: HiFiClient.API_VERSION, data: parseOpenApiSearch(fallback) }); - } - - const openApiToken = await this.getOpenApiToken(signal); -+ const includeAll = 'albums.artists,albums.coverArt,artists.profileArt,playlists.coverArt,tracks.albums,tracks.albums.coverArt,tracks.artists,videos.artists,videos.image'; - - const mapping: Array<[string | undefined, string, Params]> = [ - [ - q, - `https://openapi.tidal.com/v2/searchResults/${encodeURIComponent(q || '')}`, - { - limit, - offset, -- include: 'albums,artists,tracks,videos,playlists,topHits', -+ include: includeAll, - countryCode: this.#countryCode, - }, - ], - [ - s, - `https://openapi.tidal.com/v2/searchResults/${encodeURIComponent(s || '')}`, -- { limit, offset, include: 'tracks', countryCode: this.#countryCode }, -+ { limit, offset, include: includeAll, countryCode: this.#countryCode }, - ], - [ - a, - `https://openapi.tidal.com/v2/searchResults/${encodeURIComponent(a || '')}`, -- { limit, offset, include: 'artists,tracks', countryCode: this.#countryCode }, -+ { limit, offset, include: includeAll, countryCode: this.#countryCode }, - ], - [ - al, - `https://openapi.tidal.com/v2/searchResults/${encodeURIComponent(al || '')}`, -- { limit, offset, include: 'albums', countryCode: this.#countryCode }, -+ { limit, offset, include: includeAll, countryCode: this.#countryCode }, - ], - [ - v, - `https://openapi.tidal.com/v2/searchResults/${encodeURIComponent(v || '')}`, -- { limit, offset, include: 'videos', countryCode: this.#countryCode }, -+ { limit, offset, include: includeAll, countryCode: this.#countryCode }, - ], - [ - p, - `https://openapi.tidal.com/v2/searchResults/${encodeURIComponent(p || '')}`, diff --git a/tsconfig.json b/tsconfig.json index 57266dc..2491a53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,17 +7,17 @@ "types": ["vite/client", "node", "@types/wicg-file-system-access"], "baseUrl": ".", "paths": { - "!/*": ["node_modules/*"] + "!/*": ["node_modules/*"], }, "allowJs": true, "checkJs": false, "resolveJsonModule": true, "isolatedModules": true, "verbatimModuleSyntax": true, - "ignoreDeprecations": "6.0", + "ignoreDeprecations": "5.0", "skipLibCheck": true, - "noEmit": true + "noEmit": true, }, "include": ["**/*.ts", "*.ts", "**/*.js", "*.js"], - "exclude": ["**/node_modules/*"] + "exclude": ["**/node_modules/*"], }