Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 06-11-2022, 11:43 AM   #1
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
ePub version in template function?

Is there any way to identify the ePub version using template programming language (or a plugin) for use in a column?
tamaracks is offline   Reply With Quote
Old 06-11-2022, 01:14 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by tamaracks View Post
Is there any way to identify the ePub version using template programming language (or a plugin) for use in a column?
The answer depends on what you are want to accomplish. What are you trying to do?
chaley is offline   Reply With Quote
Advert
Old 06-11-2022, 01:45 PM   #3
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
To be able to see what version epub it is without opening it and to use that info to decide what other steps I take with the book.
tamaracks is offline   Reply With Quote
Old 06-11-2022, 01:55 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by tamaracks View Post
To be able to see what version epub it is without opening it and to use that info to decide what other steps I take with the book.
Ahh, sorry I missed the word "version". There is nothing in the template language that can do that. A plugin could open the book's OPF and check, but I don't know any plugin that does that.
chaley is offline   Reply With Quote
Old 06-11-2022, 01:59 PM   #5
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: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quality check Plugin: Search EPUBS
(note: Adjust search term)
Attached Thumbnails
Click image for larger version

Name:	Search OPF.JPG
Views:	537
Size:	36.5 KB
ID:	194301  
theducks is offline   Reply With Quote
Advert
Old 06-11-2022, 02:12 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
Quality check Plugin: Search EPUBS
(note: Adjust search term)
This is a manual process that will identify and select epub3 books. You then must use the list to set a column, probably Yes/No.

The steps:
  1. One time: create a column to store the results. I assume it will be a Yes/No column named Is Epub3 (#isepub3)
  2. Use Bulk Metadata Edit to set #isepub3 to false (or empty) for all books
  3. Use Quality Check to search the OPF for
  4. Code:
    xmlns="http://www.idpf.org/2007/opf" version="3.0"
    That is probably safe and won't find any non-epub3 books.
  5. Calibre will show all books that matched. Select them.
  6. Use Bulk Metadata to set #isepub3 to true.
  7. Use #ispub3 in your templates.
You must repeat the above process anytime a book is added or might change from 2 to 3 or vice versa.

Last edited by chaley; 06-11-2022 at 04:19 PM. Reason: Fixed numbering problem
chaley is offline   Reply With Quote
Old 06-11-2022, 05:21 PM   #7
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
Thanks, I think I can work with that!
tamaracks is offline   Reply With Quote
Old 06-17-2023, 07:38 PM   #8
tomsem
Grand Sorcerer
tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.
 
Posts: 6,939
Karma: 27060151
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
Thanks for this recipe.

However, since most of my books are only in an Amazon format or PDF at this point, I created a Text column with 3 values: Yes,No,"" and set default to "".

Then selected all ePub and bulk updated that list to 'No'.

Finally ran the OPF search and set those to 'Yes'.
tomsem is offline   Reply With Quote
Old 06-17-2023, 07:54 PM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by tomsem View Post
However, since most of my books are only in an Amazon format or PDF at this point, I created a Text column with 3 values: Yes,No,"" and set default to "".
You could have done this with a yes/no column unless you have changed them from tristate (yes, no, empty) to bistate (yes, no).

Your solution does permit adding more options, as would using a "Text, but with a fixed set of permitted values" column.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Short title template function TreeFrogBandit Library Management 2 06-11-2022 05:37 AM
BuiltinAdd template language function DyckBook Editor 4 10-19-2021 04:21 PM
Using built-in template functions in a custom template function ilovejedd Library Management 4 01-28-2018 12:20 PM
Problem with contains function in save template MicaOlaAdams Calibre 5 10-21-2016 10:25 AM
how to use re() function in Template Program Mode? msciwoj Library Management 3 07-07-2016 03:55 PM


All times are GMT -4. The time now is 03:52 AM.


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