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 07-09-2024, 01:56 AM   #691
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: 37,948
Karma: 150333332
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by YGKGamer View Post
Is it possible to create a template that can be used to do the following when importing books:
1. Ensure that author is always = last name, first name (title case)
This one is not really doable. Too many exceptions. L. Sprague de Camp for instance would be de Camp, L. Sprague while Marissa de Fontaine would be Fontaine, Marissa de, Alexandre Dumas père and Alexandre Dumas fils, Ludwig van Beethoven is sorted as Beethoven, Ludwig van. You can handle about 90% of the author names automatically but the remainder will be a pain as you start setting up exceptions and exceptions to the exceptions.
DNSB is offline   Reply With Quote
Old 07-11-2024, 04:28 PM   #692
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 75,114
Karma: 131686272
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by YGKGamer View Post
Is it possible to create a template that can be used to do the following when importing books:
1. Ensure that author is always = last name, first name (title case)
2. Title is always title case
3. Tags can be changed into a set list of tags (convert the incoming tags to ones I want and then drop the rest)
4. Series will be listed name and series number
5. Make sure the rating field is blank
6. Make sure the comment field is blank
7. strip blanks that appear in names or titles as _

Sorry I am not a programmer and the help functions were not at my level of understanding so I do not know what syntax to use.
You cannot make sure the author is always last name, first name via programming. You have to have a look at the author name. You can use the Quality Check plugin to swap the FN & LN for the entries that are FN LN.. But the problem is that some eBooks have the author name in the metadata as last name first name and so you cannot program it to be swapped or you put it in the way you don't want.
JSWolf is offline   Reply With Quote
Old 07-11-2024, 05:25 PM   #693
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: 30,121
Karma: 57500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
And there are the edge cases:
Joe and Marry Smith

Trying for a fully automated FIX is futile.
Come on, it takes seconds to fix some of these. The only time Bulk assistance would be of help, is the initial conversion from a filesystem only or documenting your paper library (Took me about a year to get my 900+ paperback metadata close. Some were pre-ISBN. OK Lots )
theducks is offline   Reply With Quote
Old 07-18-2024, 11:48 PM   #694
correoparaappzz
Member
correoparaappzz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis


Hi, i want to make a column for stand-alone books (when they don't have nothing on the "Series" column)
correoparaappzz is offline   Reply With Quote
Old 07-19-2024, 01:12 AM   #695
correoparaappzz
Member
correoparaappzz began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by correoparaappzz View Post


Hi, i want to make a column for stand-alone books (when they don't have nothing on the "Series" column)
don't worry i already figured out
correoparaappzz is offline   Reply With Quote
Old 07-19-2024, 03:41 AM   #696
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,032
Karma: 62040591
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question:

Code:
program:

cleaned_tags = 'whatever';

## Add anthology/omnibus/short story if applicable

	if 'short-stories' && 'omnibus' in $#admintags 
	then cleaned_tags  = 'Anthology' & if cleaned_tags then ', ' & cleaned_tags fi
	elif 'short-stories' in $#admintags
	then cleaned_tags  = 'Short Story' & if cleaned_tags then ', ' & cleaned_tags fi
	elif 'omnibus' in $#admintags
	then cleaned_tags  = 'Omnibus' & if cleaned_tags then ', ' & cleaned_tags fi
	fi;

	cleaned_tags
If only 'omnibus' is in #admintags, I get 'Anthology, whatever' (instead of the expected 'Omnibus, whatever'). It works for expected with only short-story. What mistake did I make here?

Last edited by ownedbycats; 07-19-2024 at 03:43 AM.
ownedbycats is offline   Reply With Quote
Old 07-19-2024, 05:00 AM   #697
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: 11,862
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
[QUOTE=ownedbycats;4439478]Question:

Code:
program:

cleaned_tags = 'whatever';

## Add anthology/omnibus/short story if applicable

	if 'short-stories' && 'omnibus' in $#admintags 
	then cleaned_tags  = 'Anthology' & if cleaned_tags then ', ' & cleaned_tags fi...
I think this line is your problem. The && makes the if always true because 'short-stories' is true. I think you want
Code:
	if 'short-stories' in $#admintags && 'omnibus' in $#admintags
chaley is offline   Reply With Quote
Old 07-19-2024, 05:30 AM   #698
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,032
Karma: 62040591
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That did it, thanks.
ownedbycats is offline   Reply With Quote
Old Today, 01:13 PM   #699
foosion
Zealot
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 129
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2
I'd like to merge some columns I'd created, based on some criteria.

I had been keeping track of the books I've finished by putting a date in #read. Then I got a Kobo and used KoboUtilities to populate #kobopct (the pct of the book I've read on Kobo) and #kobolastread (when I last read the book on Kobo). If #pct = 100, #lastread is when I finished the book.

I'd like to create a new #whenfinished. I think the basic logic would be as follows:

Code:
if #kobopct == 100:
  #whenfinished = #kobolastread
else:
  #whenfinished = #read  [date or blank]
What would be the best way to implement this?

Last edited by foosion; Today at 01:49 PM.
foosion is offline   Reply With Quote
Old Today, 01:39 PM   #700
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: 30,121
Karma: 57500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Lately, I have noticed my Libra2 (latest FW), does something odd with just Finished books ( I Page off the end and it returns to the book list). It shows 'Finished'. Then I sort or page the list to choose my next read and all of a sudden, the Finished book is no longer Finished.

FWIW I only track Done Read by date. so I do it manually. As I don't want 'Otto' changing a already set value .
theducks is offline   Reply With Quote
Old Today, 02:03 PM   #701
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,032
Karma: 62040591
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by theducks View Post
Lately, I have noticed my Libra2 (latest FW), does something odd with just Finished books ( I Page off the end and it returns to the book list). It shows 'Finished'. Then I sort or page the list to choose my next read and all of a sudden, the Finished book is no longer Finished.
I have the same issue with my Libra H2O. Sometimes immediately after finishing a book, it appears as 99%.

As far as I can tell, it's only a visual glitch and will show itself as properly completed when you switch to the home screen or open another book and back.
ownedbycats is offline   Reply With Quote
Old Today, 02:21 PM   #702
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: 37,948
Karma: 150333332
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by ownedbycats View Post
I have the same issue with my Libra H2O. Sometimes immediately after finishing a book, it appears as 99%.

As far as I can tell, it's only a visual glitch and will show itself as properly completed when you switch to the home screen or open another book and back.
I find that with quite a few Kobo Plus books, they will not change to Finished until a sync with Kobo.
DNSB is offline   Reply With Quote
Old Today, 02:39 PM   #703
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: 11,862
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by foosion View Post
I'd like to merge some columns I'd created, based on some criteria.

I had been keeping track of the books I've finished by putting a date in #read. Then I got a Kobo and used KoboUtilities to populate #kobopct (the pct of the book I've read on Kobo) and #kobolastread (when I last read the book on Kobo). If #pct = 100, #lastread is when I finished the book.

I'd like to create a new #whenfinished. I think the basic logic would be as follows:

Code:
if #kobopct == 100:
  #whenfinished = #kobolastread
else:
  #whenfinished = #read  [date or blank]
What would be the best way to implement this?
"Best" depends on you.

There are two general approaches. The first is to use a "Column built from other columns" (a "composite" column) where the template computes the value you want in the column for the book. The second is to use the Action Chains plugin to compute the column contents on when you ask it to. I'll talk about the first. If you want to know about Action Chains then see that plugin's thread.

Here is a template for a composite column that might do most of what you want.
Code:
program:
	if $$#kobopct ==# 100 then
		whenfinished = $$#kobolastread
	else
		whenfinished = $$#read
	fi;
	whenfinished
For the language syntax look in the General Program Mode section of the calibre template language documentation. If you are going to ask more questions about this then I suggest you make a separate thread.

You might want to format the dates, in which case you would use the format_date() function after the fi, as in
Code:
	whenfinished = format_date(whenfinished, 'whatever format')
chaley is offline   Reply With Quote
Old Today, 02:59 PM   #704
foosion
Zealot
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 129
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
"Best" depends on you.

There are two general approaches. The first is to use a "Column built from other columns" (a "composite" column) where the template computes the value you want in the column for the book. The second is to use the Action Chains plugin to compute the column contents on when you ask it to. I'll talk about the first. If you want to know about Action Chains then see that plugin's thread.

Here is a template for a composite column that might do most of what you want.
Code:
program:
	if $$#kobopct ==# 100 then
		whenfinished = $$#kobolastread
	else
		whenfinished = $$#read
	fi;
	whenfinished
For the language syntax look in the General Program Mode section of the calibre template language documentation. If you are going to ask more questions about this then I suggest you make a separate thread.

You might want to format the dates, in which case you would use the format_date() function after the fi, as in
Code:
	whenfinished = format_date(whenfinished, 'whatever format')
Thank you. While I investigate that, why does this get an error as Column built from other columns?

Code:
{#kobopct: 'cmp($,100,#read,#kobolastread,#read)'}
I had thought it would compare #kobopct to 100, the choose the value (if any) from either #read or #kobolastread and put that into the whenfinished column. Instead I get a template error.
foosion is offline   Reply With Quote
Old Today, 03:04 PM   #705
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: 11,862
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by foosion View Post
Thank you. While I investigate that, why does this get an error as Column built from other columns?

Code:
{#kobopct: 'cmp($,100,#read,#kobolastread,#read)'}
I had thought it would compare #kobopct to 100, the choose the value (if any) from either #read or #kobolastread and put that into the whenfinished column. Instead I get a template error.
In Template Program Mode spaces are significant outside the template code. You can't put a space between the colon and the quote.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library Management: various questions not worth their own thread ownedbycats Library Management 156 07-23-2024 11:45 PM
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates Boilerplate4U Development 13 07-07-2020 02:35 AM
Questions on Kobo [Interfered with another thread topic] spdavies Kobo Reader 8 10-12-2014 11:37 AM
[OLD Thread] Some questions before buying the fire. darthreader13 Kindle Fire 7 05-10-2013 09:19 PM
Thread management questions meme Feedback 6 01-31-2011 05:07 PM


All times are GMT -4. The time now is 04:25 PM.


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