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

Uncaught error: Cannot read property 'length' of undefined #1667

Closed
Lucki opened this issue Aug 14, 2024 · 5 comments
Closed

Uncaught error: Cannot read property 'length' of undefined #1667

Lucki opened this issue Aug 14, 2024 · 5 comments
Labels
bug This issue identifies a bug in Nuclear.

Comments

@Lucki
Copy link
Contributor

Lucki commented Aug 14, 2024

Platform: Flatpak

Nuclear version: 0.6.36

Description of the issue:
I found one album only with the iTunesMusic provider and added that album to my favorites.
I searched for another album and could only find that one on a different metadata provider.
Now I get Uncaught error: Cannot read property 'length' of undefined when I click on the first album in the favorite list.
The UI reloads itself, any playing music gets a short outage. The application doesn't crash completely though.

I think the important steps are:

  1. Favorite an album using the iTunesMusic search, maybe it's required that it isn't available on a different search provider
  2. Switch the metadata provider
  3. Try to access the favorite album by clicking the album icon in the favorite album list
  4. Crash
  5. Switch the search provider back to iTunesMusic
  6. Try to access the same album again from the favorite album list
  7. No crash
  8. Repeat

In case you want to reproduce:
The album is "Welcome to War" by "Dex Arson".
Only iTunesMusic finds it by "Welcome to War - EP"

@Lucki Lucki added the bug This issue identifies a bug in Nuclear. label Aug 14, 2024
@nukeop
Copy link
Owner

nukeop commented Aug 14, 2024

Thanks for reporting this. Are you able to attach your config? It should be in ~/.var/app/org.js.nuclear.Nuclear/config/nuclear/config.json if you're using Flatpak.

Failing that, try ~/.config/nuclear/config.json.

@Lucki
Copy link
Contributor Author

Lucki commented Aug 14, 2024

config.json

I see it contains my playlists, for extra fun try to open the faulux playlist I imported from spotify - it'll make the UI almost unusable :D

@nukeop
Copy link
Owner

nukeop commented Aug 15, 2024

Thanks, this happens because Nuclear looks up the album data using the selected metadata provider. The album has a diferent ID in iTunes and Musicbrainz, so it can't look it up. But it's possible to simply use whatever is saved in the config withou making any extra requests, so I'm going to fix it this way.

@nukeop nukeop closed this as completed in bf920c6 Aug 15, 2024
@nukeop
Copy link
Owner

nukeop commented Aug 15, 2024

After a few more minutes, I realized that I already implemented what I said above years ago. The problem was that iTunes uses numbers as ids, and they weren't correctly compared to the albums saved in favorites, so I fixed that. In the next release this issue will be gone.

@Lucki
Copy link
Contributor Author

Lucki commented Aug 15, 2024

Confirmed working now with 0.6.37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue identifies a bug in Nuclear.
Projects
None yet
Development

No branches or pull requests

2 participants