Skip to content
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

Apple Music service assumes albums always have certain properties #725

Open
KiruPoruno opened this issue Dec 3, 2024 · 0 comments
Open

Comments

@KiruPoruno
Copy link

KiruPoruno commented Dec 3, 2024

While playing around with this tool, I came across a persistent error:

Checking directory permissions...[done]
[https://music.apple.com/us/album/an-infinite-regression/478776210?i=467902919]
 [•] Identifying service...[Apple Music]
 [•] Checking authentication...[authenticated]
 Detected [track]
 Obtaining track metadata...(failed: [Cannot read properties of undefined (reading '0')])
 [i] An error occurred while processing the query

And it took a bit to realize $SHOW_DEBUG_STACK was a thing, but once that was the case it was easy to track down the issue:

[TypeError: Cannot read properties of undefined (reading '0')
    at AppleMusic.wrapTrackMeta (src/services/apple_music.js:166:38)
    at src/services/apple_music.js:315:21]

The issue stems from the Apple Music service assuming that all tracks have an artist set on the album, this isn't the case, as I realized, although rare, it does occur (as shown with the track in the logs), and the albumInfo.artists will in such a case just be undefined

Edit: After fixing the above locally, this also happens with albumInfo.tracks.reduce() a couple lines down...

@KiruPoruno KiruPoruno changed the title Apple Music service assumes tracks have an album artist Apple Music service assumes album have an album artist and track list Dec 3, 2024
@KiruPoruno KiruPoruno changed the title Apple Music service assumes album have an album artist and track list Apple Music service assumes albums always have certain properties Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant