I had a look at the code and it turns out I was aprtially incorrect. All the library lists are sorted the same way. If you have less than 10 libraries, they are sorted by frequency, otherwise by name.
This should take care of it:
https://github.com/kovidgoyal/calibr...392a3fb65b5ced