Songlist in companion app not working with huge songlibraries
datWeazel opened this issue · comments
Issue type: Bug report
Actual behaviour
In the companion app the songlist only shows "Something went wrong" (or something along those lines) instead of the songlist.
My current theory is, that it's because I got around 10k songs in my songlibrary.
Expected behaviour
Songlist should show up.
Steps to reproduce
- Open UltrastarPlay on PC or whatever
- Add a folder to your songlibrary with an insane amount of songs (in my case ~10.000 songs)
- Open companion app on your phone.
- Try to open the song list
- ???
- No songlist.
Details
Provide some additional information:
- UltraStar Play version: 0.9 (latest)
- Operating System + version: Windows 11
- if applicable, add a log file
I can add more stuff later after work but I wanted to add the report so I don't forget it again.
I see multiple possible reasons:
- request / response data too big. But I doub't this is an issue because it is only JSON (no images etc.)
- Unity struggling to create so many Label elements.
- At the moment, all song entries are created at once and added to a ScrollView. This has bad performance.
- Instead, a ListView should be used such that only the elements that are currently visible are instantiated. This is a performance optimization.
This has been fixed for the Steam release by using a dynamically populated ListView.
I tested it with more than 10000 dummy songs. Works like a charm.