Originally Posted by davidfor
I noticed something related earlier and your report suggested an experiment.
I opened a new book and put the device to sleep. This showed the cover of the previous book. Then I opened another new book, went back to the home screen and reopened the book. This time the correct cover was shown.
Just now, I opened another new book and connected to the PC without returning to the home screen. Like you, the book doesn't show as "Im_Reading". Checking the database, the ReadStatus is 0 (unread) but the __PercentRead has a value and the current reading position is set.
From that, I would say that what is happening is that the while the reading position is being stored as you read (or maybe triggered by the connect to PC), the ReadStatus (whether the book has been opened, finished or closed) is not set until the first time it is closed. Then the rule for selecting the sleep cover is "ReadStatus = 1 and max(DateLastRead)". That basically means the last book you opened without finishing. The few occasions I have seen the wrong cover, agree with this.
I did some more playing with opening various books and seem to be consistent. For the heck of it, I backed up up the KoboReader.sqlite database and edited the ReadStatus. After disconnecting, I put the reader to sleep and the book cover showed up.