Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-26-2014, 03:25 AM   #1
Snorkledorf
Blue. Not sad...just blue
Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.
 
Snorkledorf's Avatar
 
Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
Emblems: Series number?

Is there a way to set an emblem for a specific number of a book's series? e.g. a "7" graphic for book 7.

I've tried this, but to no avail:

Code:
If the series column matches pattern...
1 of .+
The book says
1 of Series Name
Snorkledorf is offline   Reply With Quote
Old 08-26-2014, 03:32 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,265
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Assuming you have added images name 1.png, 2.png etc

you'd have to create an advanced mode rule that evaluates to the approporiate image name. Unfortunately, I dont have the time right now to create the rule for you.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-26-2014, 03:45 AM   #3
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,383
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The template for the advanced rule would be something like this
Code:
program:
	s = field('series_index');
	first_non_empty(
		cmp(s, 1.01, '1.png', '', ''),
		cmp(s, 2.01, '2.png', '', ''),
		cmp(s, 3.01, '3.png', '', ''),
		cmp(s, 4.01, '4.png', '', ''),
		cmp(s, 5.01, '5.png', '', ''),
		cmp(s, 6.01, '6.png', '', ''),
		cmp(s, 7.01, '7.png', '', ''),
		cmp(s, 8.01, '8.png', '', ''),
		cmp(s, 9.01, '9.png', '', ''),
		cmp(s, 9.99, '', '', 'bigger.png')
)
chaley is offline   Reply With Quote
Old 08-26-2014, 10:28 PM   #4
Snorkledorf
Blue. Not sad...just blue
Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.
 
Snorkledorf's Avatar
 
Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
Thanks for the answers. I'm still banging my head against 2 things:
  1. I'm okay with making 10 rules, one for each number icon, if that's easier. I have the icons ready. The problem is that the rule "If the series column matches pattern 1 of .+" (screenshot 1) isn't matching anything.

    Now I'm wondering if I should be attempting to match the phrasing of the book details area that says "1 of Series Name" (regex "1 of .+" ) or the column that says "Series Name [1]" (regex ".+\[1\]" ), which I also tried? Or am I thinking in the wrong way here?

  2. The advanced rule idea sounds interesting, but what I tried (screenshot 2) is also having no effect. There are lots of other options in the dialog so I'm likely setting something wrong there. Especially the "Apply an icon to the column" list — I'm trying to add an icon to the emblems, so I don't know how columns apply here.

Basically I'm just overall confused.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2014-08-27 at 9.24.01 AM.png
Views:	219
Size:	79.4 KB
ID:	127333   Click image for larger version

Name:	Screen Shot 2014-08-27 at 11.13.15 AM.png
Views:	265
Size:	71.5 KB
ID:	127334  
Snorkledorf is offline   Reply With Quote
Old 08-27-2014, 02:48 AM   #5
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,383
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Snorkledorf View Post
[*]The advanced rule idea sounds interesting, but what I tried (screenshot 2) is also having no effect. There are lots of other options in the dialog so I'm likely setting something wrong there. Especially the "Apply an icon to the column" list — I'm trying to add an icon to the emblems, so I don't know how columns apply here.
Ignore the other options on that screen. They will go away in the next release.

Do you already have icon files named 1.png, 2.png, etc? If you do not then the advanced rule I supplied will do nothing.

And in any event the template should be:
Code:
program:
	s = field('series_index');
	test(field('series'),
		first_non_empty(
			cmp(s, 1.01, '1.png', '', ''),
			cmp(s, 2.01, '2.png', '', ''),
			cmp(s, 3.01, '3.png', '', ''),
			cmp(s, 4.01, '4.png', '', ''),
			cmp(s, 5.01, '5.png', '', ''),
			cmp(s, 6.01, '6.png', '', ''),
			cmp(s, 7.01, '7.png', '', ''),
			cmp(s, 8.01, '8.png', '', ''),
			cmp(s, 9.01, '9.png', '', ''),
			cmp(s, 9.99, '', '', 'bigger.png')
	), '')
I forgot to use no emblem if there is no series.
chaley is offline   Reply With Quote
Advert
Old 08-29-2014, 01:12 AM   #6
Snorkledorf
Blue. Not sad...just blue
Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.
 
Snorkledorf's Avatar
 
Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
I have my emblem files named to match your code, and just in case something was messed up with what I'd done before, created a new rule with just the code pasted in. I had to select something in the Column field for it to save the rule so I selected Series.

Still no effect.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2014-08-29 at 2.08.52 PM.png
Views:	234
Size:	71.7 KB
ID:	127428  
Snorkledorf is offline   Reply With Quote
Old 08-29-2014, 03:32 AM   #7
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,383
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Snorkledorf View Post
I have my emblem files named to match your code, and just in case something was messed up with what I'd done before, created a new rule with just the code pasted in. I had to select something in the Column field for it to save the rule so I selected Series.

Still no effect.
The template is working. You can see that because the "Template value" is 1.png, which that version of the template will produce for any book that has no series or has a series with index <= 1.

Verify that the files 1.png ... are in the right directory. They must be in [Calibre configuration directory]/cc_icons. One way to do this verification is to click on the down-arrow in the box next to "Copy an icon file name to the clipboard" and see what it shows you. You can go look at the directory by clicking on Preferences / Miscellaneous / Open calibre configuration directory, then clicking on cc_icons.

Another test you can do is click on that same down arrow, select an image name, click on the clipboard button, then paste that image name over the top of 1.png. The template value should change and that image should appear on some books.

Last test: insert a standard rule putting an emblem on books if series is set. That will test the underlying mechanism and demonstrate that emblems work at all.
chaley is offline   Reply With Quote
Old 08-29-2014, 09:43 AM   #8
Snorkledorf
Blue. Not sad...just blue
Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.Snorkledorf ought to be getting tired of karma fortunes by now.
 
Snorkledorf's Avatar
 
Posts: 218
Karma: 1267018
Join Date: Oct 2009
Location: Japan
Device: Ridibooks Paper Pro
Saints be praised, that was it!

I just had to put the icons in ~/Library/Preferences/calibre/cc_icons. Makes sense that it might want to know where they are, yup. Just yelling "With all the other ones, you fool!" didn't work for some reason. Silly computers.

Also good to know that the "Template value" is giving the result of the calculation. Now I know how to know if it's working or not.

Thanks for your help, chaley, Kovid!
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2014-08-29 at 10.32.56 PM.png
Views:	282
Size:	460.1 KB
ID:	127440  
Snorkledorf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cover emblems - Where to get? delaing Calibre 10 10-22-2014 07:37 PM
Can Series number be more than one number? icaria Library Management 8 12-27-2013 02:05 AM
Series and Number Spur52 Library Management 5 09-16-2011 08:06 PM
Show series number but not if they aren't in a series? M4cc45 Library Management 10 09-03-2011 07:35 PM
What is the number in series name? coredump Calibre 1 12-21-2009 10:51 AM


All times are GMT -4. The time now is 10:00 AM.


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