Quote:
Originally Posted by ownedbycats
Think this should be sent to the Calibre bugtracker? I'll wait and see if chaley sees this first though before doing that.
|
Well, this has been fun.
I now understand what is happening. To explain:
- For performance reasons calibre keeps an in-memory copy of the data read from the database.
- When the database is originally loaded into memory, if a custom series is empty then the custom series index is set to empty (None), otherwise it is set to the series index.
- When you sort on a custom series it automatically sorts by the name then the index.
- When you edit a custom series by setting it to empty, the custom series index remains in the in-memory copy of the database.
Putting all this together, when you start calibre all the books without the custom series have an empty index so they sort identically. However, if you change (remove) the custom series that book still has the index so it sorts differently from the other empty books.
I have a fix but I don't trust my comprehension of the affected code. I will commit it, explaining to Kovid why I changed what I did so he can show me any errors of my ways.