Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-21-2018, 09:40 AM   #901
Rob557
Connoisseur
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 78
Karma: 810
Join Date: Jul 2012
Device: Kobo
thread: "[GUI Plugin] Quality Check"
Quote:
Originally Posted by fncll View Post
... the log for "Search ePub" ... Where can I view this log?
Hi fncll,
Each time a Quality Check "Search ePub" is run, a small pop-up box appears with the options of either clicking "OK", or first clicking on "view log". That latter option allows you to see the "Search ePub" results log and copy its contents. I don't otherwise know how to access that log via its filename on the hard drive but it may not be a simple stand-alone text file anyway.

FWIW, could you clarify what you mean by seeing a note in the "changelog" ... assuming that is different from the "Search ePub" results log, what action produces a "changelog" and how do you access that log?
Cheers,
Rob
Rob557 is offline   Reply With Quote
Old 10-21-2018, 11:33 AM   #902
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 22,252
Karma: 22136456
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A
'Log" files are almost always TXT files every place I have seen them over the 40 years I have been using computers (as always, there are those who think they have a better way, and use a special dataset. Duho! The computers is broken, I need a SIMPLE / UNIVERSAL way to get the log)
Notepad, Notepad++, even Copy foo.log CON: (with the optional pipe to MORE )
theducks is offline   Reply With Quote
Old 10-22-2018, 02:20 AM   #903
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 3,022
Karma: 7343536
Join Date: Jan 2009
Location: in the middle of nowhere
Device: Paperwhite 3, iPad 9.7, iPad 12.9
Question, has anyone used "Check and repair book sizes recently"? It's not working for me at all. It didn't find any discrepancies (it reported all file sizes matched) whereas there should have been thousands given I just restored ~2,000 mobi files from my backup.
ilovejedd is offline   Reply With Quote
Old 10-23-2018, 02:40 AM   #904
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 5,117
Karma: 21825480
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Aura One, Aura H2O, Aura HD, Nexus 7 HD, iPad Air, Tolino epos
Quote:
Originally Posted by ilovejedd View Post
Question, has anyone used "Check and repair book sizes recently"? It's not working for me at all. It didn't find any discrepancies (it reported all file sizes matched) whereas there should have been thousands given I just restored ~2,000 mobi files from my backup.
Worked for me last week. I had editing some epubs in Sigil removing embedded fonts (who the bleep picks those fonts?) and the file sizes don't get updated so Quality Check reports them.
DNSB is offline   Reply With Quote
Old 10-23-2018, 03:12 AM   #905
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 3,022
Karma: 7343536
Join Date: Jan 2009
Location: in the middle of nowhere
Device: Paperwhite 3, iPad 9.7, iPad 12.9
Quote:
Originally Posted by DNSB View Post
Worked for me last week. I had editing some epubs in Sigil removing embedded fonts (who the bleep picks those fonts?) and the file sizes don't get updated so Quality Check reports them.
Thanks. Maybe the plugin just didn't like seeing thousands of discrepancies. Either that or it doesn't play nice in portable mode.

In any case, I just made a #size custom column that I manually update using formats_sizes().
ilovejedd is offline   Reply With Quote
Old 10-23-2018, 05:18 PM   #906
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 3,022
Karma: 7343536
Join Date: Jan 2009
Location: in the middle of nowhere
Device: Paperwhite 3, iPad 9.7, iPad 12.9
Hmm, looking further into this issue, there appears to be two possible causes:

1.) Caching: If I change files while Calibre is shut down, the Quality Check plugin doesn't catch any of the changes but sometimes it does if I make changes while Calibre is running.

2.) Possible use of a mapped legacy function to get the "db" size.

/src/calibre/db/legacy.py -> I believe format_metadata uses os.stat which would give the same file size as os.path.getsize
Code:
    def sizeof_format(self, index, fmt, index_is_id=False):
        book_id = index if index_is_id else self.id(index)
        return self.new_api.format_metadata(book_id, fmt).get('size', None)
/src/calibre/library/database.py
Code:
    def sizeof_format(self, index, format, index_is_id=False):
        ''' Return size of C{format} for book C{index} in bytes'''
        id = index if index_is_id else self.id(index)
        format = format.upper()
        return self.conn.get('SELECT uncompressed_size FROM data WHERE data.book=? AND data.format=?', (id, format), all=False)

Quality Check/check_fix.py
Code:
    for fmt in formats.split(','):
        db_size = db.sizeof_format(book_id, fmt, index_is_id=True)
        book_path = db.format_abspath(book_id, fmt, index_is_id=True)
        if not book_path:
            self.log.error('Unable to find path to book id:', book_id, db.title(book_id, index_is_id=True))
            continue
        if os.path.exists(book_path):
            actual_size = os.path.getsize(book_path)
            if actual_size != db_size:
That's pretty much the extent of my practically non-existent Python reading skills.

Fixing the code so sizeof_format gets information from database instead of os.stat or to prevent caching is way beyond my skill set. I'm fairly adept at cut-and-paste though, so I managed to add a nuclear option Force repair book sizes. Per the option name, this will forcibly update the sizes for all formats regardless if it's been changed or not so use with care. I only use it with Search scope - Selected book(s).
Attached Files
File Type: zip Quality Check-mod.zip (128.9 KB, 12 views)
ilovejedd is offline   Reply With Quote
Old 11-04-2018, 01:38 PM   #907
fncll
Member
fncll began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2002
Location: AK
Quote:
Originally Posted by Rob557 View Post
thread: "[GUI Plugin] Quality Check"
Hi fncll,
Each time a Quality Check "Search ePub" is run, a small pop-up box appears with the options of either clicking "OK", or first clicking on "view log". That latter option allows you to see the "Search ePub" results log and copy its contents. I don't otherwise know how to access that log via its filename on the hard drive but it may not be a simple stand-alone text file anyway.

FWIW, could you clarify what you mean by seeing a note in the "changelog" ... assuming that is different from the "Search ePub" results log, what action produces a "changelog" and how do you access that log?
Cheers,
Rob
Thanks. I've overlooked that button a thousand times!

By "changelog" I meant the one that is inside the ZIP file along with the plugin source. I made a copy and modified the plugin to provide more lines of context (if I can figure it out I will offer code to the developer to make that a user-selectable option). I also want to have it write a copy of the log each time it is run!
fncll is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Open With kiwidude Plugins 332 08-31-2018 09:54 AM
[GUI Plugin] Search the Internet kiwidude Plugins 294 07-11-2018 07:47 PM
[GUI Plugin] Clipboard Search kiwidude Plugins 9 08-12-2014 04:36 AM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 01:02 AM
[GUI Plugin] Book Sync **Deprecated** kiwidude Plugins 111 06-07-2011 08:47 PM


All times are GMT -4. The time now is 05:09 AM.


MobileRead.com is a privately owned, operated and funded community.