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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-22-2012, 08:11 PM   #316
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by remus.grrrl View Post
A HA HA HA......finally got the dang thing to work.......at least with the newer calibre (0.8.70) You do NOT put the plugboard expression in the Metadata Plugboard like I thought.....You put it in the save to disk, template area. As below....now it works perfectly.....
Congrats. Thanks for sharing. Metadata plugboards are designed to change the metadata on the fly when you Send to device. As you found out it has no effect on Save to disk.

Congrats again for twisting the info in the metadata plugboard to your needs as a Save to disk template. Well done!
DoctorOhh is offline   Reply With Quote
Old 10-02-2012, 08:51 AM   #317
tlrowley
Quilt Geek
tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Posts: 472
Karma: 91775
Join Date: Aug 2007
Location: Lancaster, PA
Device: Kindle
I have some plugboards set up for a long time, now, and I've been really pleased with how they're working. I've run into a small issue, though, that I hope someone might have some ideas.

I have a plugboard set up for the content server, any format. Basically, I just want to put the series number at the start of the title. (I only added the "Tracey" to make the changes obvious while I worked on the plugboard )

I have a lot of books that I have in epub and mobi. The plugboard works perfectly for the pubs, but the mobi files that are downloaded do not appear to have had the plugboard applied.


So, what am I missing? User error, or a problem in the plugboard? Thanks for any pointers you can provide. I'm on a mac, running calibre 0.9.
Attached Thumbnails
Click image for larger version

Name:	calibre-20121002-053913.jpg.jpg
Views:	598
Size:	117.2 KB
ID:	93221   Click image for larger version

Name:	Downloads-20121002-054724.jpg.jpg
Views:	506
Size:	19.7 KB
ID:	93222  

Last edited by tlrowley; 10-02-2012 at 08:53 AM.
tlrowley is offline   Reply With Quote
Old 10-02-2012, 09:53 AM   #318
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,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The content server supports plugboards only for epub.

Starting with 0.9.0, calibre displays a warning message when you set up an "any format" plugboard for the content server.

Last edited by chaley; 10-02-2012 at 09:57 AM.
chaley is offline   Reply With Quote
Old 10-02-2012, 09:56 AM   #319
tlrowley
Quilt Geek
tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.tlrowley is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Posts: 472
Karma: 91775
Join Date: Aug 2007
Location: Lancaster, PA
Device: Kindle
Well, that wold explain it, then, wouldn't it?

Thanks for the help.
tlrowley is offline   Reply With Quote
Old 10-10-2012, 10:57 PM   #320
TicklishOwl
Member
TicklishOwl began at the beginning.
 
TicklishOwl's Avatar
 
Posts: 16
Karma: 10
Join Date: Oct 2012
Location: Chicago
Device: Kobo Aura, Kobo Touch
help with template code for custom column

I'm trying to set up a composite custom column (built from Calibre's tags column), but I'm having trouble with the template code.

I have a custom column #koboshelves that is used to populate shelves on my Kobo Touch (via the Kobo device driver). I have dozens of tags, but I only want to use a few to populate #koboshelves.

I have the following #koboshelves:
Fantasy & SciFi
Historical Fiction
Middle-Grade

I'd like books containing these tags to autofill #koboshelves:
fantasy (add to Fantasy & SciFi shelf)
historical (add to Historical Fiction shelf)
middle-grade (add to Middle-Grade shelf)
scifi (add to Fantasy & SciFi shelf)

Example: A book tagged 'classics, france, historical, middle-grade' would add 'Historical Fiction, Middle-Grade' to #koboshelf.

It's easy to get a single tag to work:
Code:
{tags:contains(historical, Historical Fiction,)}
Unfortunately, I can't get multiple tags to work. Clearly I do not have a gift for this language. I'd be most grateful for some guidance.
TicklishOwl is offline   Reply With Quote
Old 10-11-2012, 03:00 AM   #321
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,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by TicklishOwl View Post
I'm trying to set up a composite custom column (built from Calibre's tags column), but I'm having trouble with the template code.

...
Example: A book tagged 'classics, france, historical, middle-grade' would add 'Historical Fiction, Middle-Grade' to #koboshelf.

It's easy to get a single tag to work:
Code:
{tags:contains(historical, Historical Fiction,)}
Unfortunately, I can't get multiple tags to work. Clearly I do not have a gift for this language. I'd be most grateful for some guidance.
Use a general program mode template like the following
Code:
program:
	t = field('tags');
	l = '';
	l = list_union(l, in_list(t, ',', 'space', 'Space Opera', ''), ',');
	l = list_union(l, in_list(t, ',', 'science', 'Science Fiction', ''), ',');
	l = list_union(l, in_list(t, ',', 'alternate', 'Alternate History', ''), ',');
	l = list_union(l, in_list(t, ',', 'a', 'b', ''), ',');
This template constructs a list of tags returned by the in_list functions.

Note 1: in_list takes a regular expression for the match pattern. If there are multiple tags that result in the same shelf, you can write it like this
Code:
list_union(l, in_list(t, ',', 'tag1|tag2', 'Space Opera', ''), ',');
Note 2: if you want exact matching on the tags, use something like
Code:
list_union(l, in_list(t, ',', '^space$', 'Space Opera', ''), ',');
or in the case of a multiple match
Code:
list_union(l, in_list(t, ',', '^(tag1|tag2)$', 'Space Opera', ''), ',');
Note 3: this template is at the limit of what the template system is intended to do. If you have a large library, it will probably be slow. What "large" means depends on the computer running calibre. If you have python skills, or if you know someone with those skills, a custom calibre template function will have much better performance.
chaley is offline   Reply With Quote
Old 10-11-2012, 03:55 PM   #322
TicklishOwl
Member
TicklishOwl began at the beginning.
 
TicklishOwl's Avatar
 
Posts: 16
Karma: 10
Join Date: Oct 2012
Location: Chicago
Device: Kobo Aura, Kobo Touch
Thank you so much, Chaley! It works perfectly.

I was using list_re instead of list_union. My knowledge of python in limited, hence the ham-handed attempts. I haven't noticed a decrease in Calibre's performance, so a custom template function can wait until I learn more python.

Last edited by TicklishOwl; 09-01-2015 at 02:57 AM.
TicklishOwl is offline   Reply With Quote
Old 10-27-2012, 08:58 PM   #323
Lazarus416
Junior Member
Lazarus416 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2012
Device: Kindle Keyboard
Nexus 7 / Moonreader+ template?

I am wanting to make a template for the books I send to my Nexus 7, using Moonreader to read them. Which "device" do I choose to make it work? When I choose Android device it says "Android devices do not support MOBI format", and when I use the "MTP device" it does not apply the template. (I want to put the series & Series# in the title.)

Alternatively does anyone know a tablet/e-reader app that works well other than Moonreader? Of the ones I have looked at, it works easiest so far. But I want to be able to see the series metadata somehow so I can read the books in order.

Thanks in advance for any info.
Lazarus416 is offline   Reply With Quote
Old 10-27-2012, 10:20 PM   #324
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Lazarus416 View Post
(I want to put the series & Series# in the title.)

Alternatively does anyone know a tablet/e-reader app that works well other than Moonreader? Of the ones I have looked at, it works easiest so far. But I want to be able to see the series metadata somehow so I can read the books in order.
To start Moonreader + shows all calibre series info if you sort by tags. It places the series at the top of the tags list. When you open a series from this list all of the books will be in order.

That said, I would suggest using the Calibre Companion (CC) App to transfer books to your device (wifi required). I use it to manage the books on my Nexus 7 and open books via CC in Moonreader +. When you transfer books CC uses the metadata from calibre's library and you see the author, title, series and series index by default so no plugboard required, see attached. I no longer import any books into Moonreader+ I simply use CC to launch whatever book I desire to read.

Good Reading.
Attached Thumbnails
Click image for larger version

Name:	2012-10-27 22.18.00.png
Views:	445
Size:	377.0 KB
ID:	95048   Click image for larger version

Name:	2012-10-27 22.15.14.png
Views:	417
Size:	253.9 KB
ID:	95049  

Last edited by DoctorOhh; 10-27-2012 at 10:30 PM.
DoctorOhh is offline   Reply With Quote
Old 10-28-2012, 03:43 PM   #325
Lazarus416
Junior Member
Lazarus416 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2012
Device: Kindle Keyboard
Thanks for reminding me of CC. I had forgotten about it. I have it on my phone, but I don't read much on my phone so I didn't think about it. It is a bit cumbersome to use vs plugging via USB, but not enough to make it an issue. I tried sorting by tags in Moonreader+ (just to see if I had missed something) but all it shows are the tags I put on the books, not the series info. I have not found any way to do that yet in MR+, but since I have CC now, it's not a major issue. Thanks.
Lazarus416 is offline   Reply With Quote
Old 09-04-2013, 11:08 AM   #326
packetfire
Junior Member
packetfire began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2013
Device: Kindle Paperwhites (His and Hers)
The Python code, faithfully copied from the instructions for the "flagging books as read" instructions, goes into the "Programming Code" box as one long line, and word-wraps around.
When I press the "create" button, I get a "SyntaxError: invalid syntax" error, which does not surprise me, given that the box into which I am pasting the code warns "Be Sure To Follow Python Indenting Rules".
Problem is, I don't speak a word of Python.
Can anyone help me with a better-formatted version of the code?


Never mind, found properly formatted code here:
https://www.mobileread.com/forums/showpost.php?p=1353631&postcount=137

Last edited by packetfire; 09-04-2013 at 11:31 AM.
packetfire is offline   Reply With Quote
Old 09-12-2013, 05:28 AM   #327
INCSlayer
Member
INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.INCSlayer knows what is on the back of the AURYN.
 
Posts: 15
Karma: 9794
Join Date: May 2013
Device: Pocketbook Touch Lux 2(626)
im trying to make a template that uses a custom shelf but only if the custom shelf is populated otherwise i want it to use the series index without duplicates so this:

{#truenumber:0>2s| | - }{series_index:0>2s| | - }{author}

works but in that if there is no truenumber but if there is a truenumber i get a duplicate from the series index is there any easy way to to simply have it not send series index if its sending truenumber?
INCSlayer is offline   Reply With Quote
Old 09-12-2013, 07:33 AM   #328
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,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by INCSlayer View Post
im trying to make a template that uses a custom shelf but only if the custom shelf is populated otherwise i want it to use the series index without duplicates so this:

{#truenumber:0>2s| | - }{series_index:0>2s| | - }{author}

works but in that if there is no truenumber but if there is a truenumber i get a duplicate from the series index is there any easy way to to simply have it not send series index if its sending truenumber?
Using template program mode:
Code:
{#truenumber:0>2s| | - }{series_index:0>2s:'test(field('#truenumber'), '', $)'| | - }{author}
chaley is offline   Reply With Quote
Old 09-30-2013, 09:20 AM   #329
Accel
Junior Member
Accel began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Sep 2013
Location: Moscow, Russia
Device: iPad
Question

Quote:
Originally Posted by Sweetpea View Post

{#author_title_sort} is a field that looks a bit like {author_sort}, except I don't want the entire first name. Especially on my PDA, where the screenwidth is not too wide, the full name would take too much room.

"Andersen, Hans Christian - Fairy Tales"
vs
"Andersen, H.C. - Fairy Tales"
How did you do #author_title_sort ?
Accel is offline   Reply With Quote
Old 10-12-2013, 01:17 PM   #330
Ayack
Junior Member
Ayack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2012
Device: Kindle
Unhappy

Hi, can you help me to adapt the code that shows ebook reading status in custom column to French please?

In the comments, there is:

Code:
05/07/13
Dernière page lue : Emplacement 6514 (99%)
instead of:

Code:
1/24/2011
Last Page Read: Location 721 (99%)
I've tried:

Code:
def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct,  
				is_reading_str, no_page_read_str):
	try:
		test_val = int(is_read_pct)
	except:
		return 'is_read_pct is not a number'

	import re
	mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Dernière page lue : Emplacement \d+ \((\d+)%\)', val, re.I + re.DOTALL);
	if mg is None:
		return no_page_read_str
	date = mg.group(1)
	pct = mg.group(2)
	try:
		f = int(pct)
		if f > test_val:
			return date
		elif f > 0:
			return is_reading_str + ': ' + pct + '%'
	except:
		pass
	return no_page_read_str
but it does't work...

Ayack is offline   Reply With Quote
Reply

Tags
custom column, tag, tags

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM
Using Custom Metadata in Save Template EJvdH Calibre 1 07-02-2010 06:06 AM
Accessories Decalgirl Kindle 2 custom skin template srmalloy Amazon Kindle 6 04-09-2010 09:55 PM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 05:41 PM.


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