-
-
Notifications
You must be signed in to change notification settings - Fork 11
Fix issue TypeError: Cannot read properties of undefined (reading 'runs') at Module.get_playlist #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue TypeError: Cannot read properties of undefined (reading 'runs') at Module.get_playlist #20
Changes from 1 commit
7684d5d
b0b37b7
edaa200
4ca6d5a
f10c713
38e41b7
4b4dd83
6e46fcb
ef961c7
cd14546
137f442
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -115,27 +115,22 @@ export interface ArtistRun { | |||||||||||||||||
| type: "artist" | "channel"; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export function parse_song_artists_runs(runs: any) { | ||||||||||||||||||
| const artists: ArtistRun[] = []; | ||||||||||||||||||
| const result = Array(Math.floor(runs.length / 2) + 1).fill(undefined).map(( | ||||||||||||||||||
| _, | ||||||||||||||||||
| index, | ||||||||||||||||||
| ) => index); | ||||||||||||||||||
|
|
||||||||||||||||||
| export function parse_song_artists_runs(runs) { | ||||||||||||||||||
| if (!runs) | ||||||||||||||||||
| return []; | ||||||||||||||||||
|
nico-iaco marked this conversation as resolved.
Outdated
|
||||||||||||||||||
| const artists = []; | ||||||||||||||||||
|
||||||||||||||||||
| export function parse_song_artists_runs(runs) { | |
| if (!runs) | |
| return []; | |
| const artists = []; | |
| export function parse_song_artists_runs(runs: { text: string }[] | undefined): ArtistRun[] { | |
| if (!runs) | |
| return []; | |
| const artists: ArtistRun[] = []; |
Copilot
AI
Jul 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating an intermediate array with fill and map, consider iterating directly over runs using for (let i = 0; i < runs.length; i += 2) to reduce memory allocations.
| const result = Array(Math.floor(runs.length / 2) + 1).fill(undefined).map((_, index) => index); | |
| for (const i of result) { | |
| const run = runs[i * 2]; | |
| for (let i = 0; i < runs.length; i += 2) { | |
| const run = runs[i]; |
Uh oh!
There was an error while loading. Please reload this page.