advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.8k stars 480 forks source link

[Bug]: "Add to collection" is slow/crashes, especially on mobile devices #3569

Open xcy7e opened 2 weeks ago

xcy7e commented 2 weeks ago

What happened?

I have ~20 collections with ~200 titles related in total. Depending on the device (Laptop is fine, mobile device is unusable) it takes minutes until the list of collections loaded, when trying to add a title to a collection.

Advplyr once told me, this is because of the old objectional DB schema.

I wonder if it can be improved, either by migrating the affected table schemas or by Changing the "load collections" function. There was a patch, that brought improvement, quite a while ago, but not significantly.

I assume it wouldn't be necessary to load all related titles when loading the collections in this specific context, but rather only the first 2 for the covers and the current context's title to see where it has been added already.

Personally I would't even need the Covers in that modal List.

Another workaround could be, to be able to add titles from within a collection.

On my Galaxy S20 I am at the point where I can't add more titles, since the browser crashes everytime. It seems, it's loading way too many things.

This makes the "Collections" - Feature mostly unusable to me & most of my users.

What did you expect to happen?

Collections List modal loads within seconds

Steps to reproduce the issue

  1. Add 10-20 collections
  2. Relate 100-200 titles to the collections in total
  3. Try to add a title to a collection on a mobile device
  4. Takes minutes to load or crashes due to memory exhaustion

Audiobookshelf version

v2.16.2

How are you running audiobookshelf?

Debian/PPA

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Other (list in "Additional Notes" box)

Logs

INFO

[SocketAuthority] Socket TxIQgNFGpDSPrAiRAAAT disconnected from client "jonathan" after 196972ms (Reason: transport close)

Additional Notes

Affects every mobile browser similary

nichwall commented 2 weeks ago

Would you be willing to share your database so I can do some testing with the large collections? You can zip it to make it much smaller, then send it to the email on my GH profile or to nyxholas on the ABS Discord.

xcy7e commented 1 day ago

@nichwall I prepared the database & sent you an email with further details for the data exchange.