Quote:
Originally Posted by theducks
Kiwidude, how does check sizes determine which size to use? My Python reading skills are rock bottom, but the only comparison I saw was to the DB, not to other formats found (I definitely could be wrong  , self closing loops  gimme a endfor any day  )
|
I just ran this against my library. Due to all the Sigil editing work I do, I had thousands of "discrepancies". However when I ran the check again it found zero matches as expected, reporting all book sizes were correct. Did you have your search scope set to selected rather than library or something odd? Can't really imagine how you got the behaviour you described, certainly it all worked as expected for me.
As to how it all works, I believe there is a sql subquery run for the size column where it selects the max largest of this size data of the formats for a book when displaying in the gui. You might have cached out of date stuff on screen if you don't get the update you expect possibly.
Certainly I haven't seen anything not working as it should to my eyes, or from the code any reason why it shouldn't be behaving correctly. The only one possible thing is that I believe Kovid may have changed the python function he calls to get the size of a file (I am 99% sure I copied his code at the time to ensure when I compare the current value with calibre's value they have the same code to get the same number). He now uses os.stat, whereas my plugin uses os.path.getsize(). You would hope that one is just a wrapper for the other, and certainly on my Windows 7 system it all worked fine...