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 11-21-2020, 10:16 PM   #1
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
"Normal" template inside GPM template

Code:
program:
   if field('#readorder') then
	 'Reading List: {#readorder} #{#readorder_index:0>2s'
   fi
How do I get this to not return the Reading List template as an exact string?

Last edited by ownedbycats; 11-21-2020 at 10:23 PM.
ownedbycats is online now   Reply With Quote
Old 11-22-2020, 07:02 AM   #2
chaley
Grumpy old git
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: 9,414
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
Moderator Notice
Moved to its own thread
chaley is offline   Reply With Quote
Old 11-22-2020, 07:21 AM   #3
chaley
Grumpy old git
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: 9,414
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
Three solutions. I used #series for #readorder.

1) Use GPM and the template function:
Code:
program:
	if field('#series') then
		 template('Reading List: {#series} #{#series_index:0>2s}')
	fi
2) Use a normal template, which is probably a bit faster than 1) because it avoids the nested template call
Code:
{#series:|Reading List: |}{#series_index:0>2s| #|}
3) Use GPM but avoid the call to template(). This will be the fastest if it is used as a rule or a composite column template.
Code:
program:
	f = field('#series');
	if f then
		strcat(
			'Reading List: ', f, ' #', 
			format_number(field('#series_index'), '0>2d')
		)
	fi
chaley is offline   Reply With Quote
Old 11-22-2020, 12:13 PM   #4
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
Thank you.
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:10 PM   #5
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
Code:
program:
	if field('#readorder') then
		 template('Reading List: {#readorder} #{#readorder_index:0>2s}')
  else
	if field('#fanficcat') then
		 template('{#fanficcat}')	
	fi
fi
This puts "PLUGBOARD TEMPLATE ERROR" on everything that's not a fanfic or on a reading list.

I'm not sure how exactly to tell it to not put anything in there if those two don't apply.

(For reference, this is in the "subtitle" field on the KoboTouchExtended driver.)

Last edited by ownedbycats; Yesterday at 02:21 PM.
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:21 PM   #6
chaley
Grumpy old git
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: 9,414
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
Quote:
Originally Posted by ownedbycats View Post
Code:
program:
	if field('#readorder') then
		 template('Reading List: {#readorder} #{#readorder_index:0>2s}')
  else
	if field('#fanficcat') then
		 template('{#fanficcat}')	
	fi
fi
This puts "PLUGBOARD TEMPLATE ERROR" on everything that's not a fanfic or on a reading list. Did I miss a step?
It works fine for me. Are you sure you copied the template you are really using to your post?

Example: this template works on calibre 5.6, substituting '#series' for '#readorder' and '#enum' for '#fanficcat'. If neither is set the template produces an empty value.
Code:
program:
	if field('#series') then
		 template('Reading List: {#series} #{#series_index:0>2s}')
	else
		if field('#enum') then
			template('{#enum}')	
		fi
	fi
EDIT: You are using this template in a plugboard? I need to look at that.

EDIT 2: Run calibre in debug mode and post the exception information.

Last edited by chaley; Yesterday at 02:27 PM.
chaley is offline   Reply With Quote
Old Yesterday, 02:36 PM   #7
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
It shows a "PLUGBOARD TEMPLATE ERROR" as the subtitle itself.

There's only one part in the log mentioning the template itself:

Code:
DEBUG:    0.0 KoboTouch:books - driver options= Driver:KoboTouchExtended, Options - format_map: ['kepub', 'epub', 'cbr', 'cbz', 'pdf', 'txt'], use_subdirs: True, read_metadata: True, use_author_sort: False, save_template: {#kobopath}/{author_sort}/{title} - {authors}, extra_customization: [], manage_collections: True, collections_columns: #kobocoll, create_collections: True, delete_empty_collections: True, ignore_collections_names: , upload_covers: True, dithered_covers: False, keep_cover_aspect: True, upload_grayscale: False, letterbox_fs_covers: False, png_covers: False, show_archived_books: False, show_previews: False, show_recommendations: False, update_series: True, update_core_metadata: True, update_purchased_kepubs: True, update_device_metadata: True, update_subtitle: True, subtitle_template: program:
	if field('#readorder') then
		 template('Reading List: {#readorder} #{#readorder_index:0>2s}')
	else
		if field('#fanficcat') then
			template('{#fanficcat}')	
		fi
	fi, modify_css: False, override_kobo_replace_existing: False, support_newer_firmware: True, debugging_title: , driver_version: 3.4.1, extra_features: True, upload_encumbered: False, skip_failed: False, hyphenate: False, smarten_punctuation: False, clean_markup: False, full_page_numbers: False, disable_hyphenation: False, file_copy_dir: , hyphenate_chars: 6, hyphenate_chars_before: 3, hyphenate_chars_after: 3, hyphenate_limit_lines: 2
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:38 PM   #8
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
I was able to view the full subtitle on the Kobo itself by going into book details

Code:
PLUGBOARD TEMPLATE ERROR Formatter: Failed to scan program. Invalid input }') fi near '{#fanficcat'
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:41 PM   #9
chaley
Grumpy old git
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: 9,414
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
Quote:
Originally Posted by ownedbycats View Post
It shows a "PLUGBOARD TEMPLATE ERROR" as the subtitle itself.

There's only one part in the log mentioning the template itself:

Spoiler:
Code:
DEBUG:    0.0 KoboTouch:books - driver options= Driver:KoboTouchExtended, Options - format_map: ['kepub', 'epub', 'cbr', 'cbz', 'pdf', 'txt'], use_subdirs: True, read_metadata: True, use_author_sort: False, save_template: {#kobopath}/{author_sort}/{title} - {authors}, extra_customization: [], manage_collections: True, collections_columns: #kobocoll, create_collections: True, delete_empty_collections: True, ignore_collections_names: , upload_covers: True, dithered_covers: False, keep_cover_aspect: True, upload_grayscale: False, letterbox_fs_covers: False, png_covers: False, show_archived_books: False, show_previews: False, show_recommendations: False, update_series: True, update_core_metadata: True, update_purchased_kepubs: True, update_device_metadata: True, update_subtitle: True, subtitle_template: program:
	if field('#readorder') then
		 template('Reading List: {#readorder} #{#readorder_index:0>2s}')
	else
		if field('#fanficcat') then
			template('{#fanficcat}')	
		fi
	fi, modify_css: False, override_kobo_replace_existing: False, support_newer_firmware: True, debugging_title: , driver_version: 3.4.1, extra_features: True, upload_encumbered: False, skip_failed: False, hyphenate: False, smarten_punctuation: False, clean_markup: False, full_page_numbers: False, disable_hyphenation: False, file_copy_dir: , hyphenate_chars: 6, hyphenate_chars_before: 3, hyphenate_chars_after: 3, hyphenate_limit_lines: 2
This doesn't make sense, assuming you are running in debug mode. The only time that string is used is if there is an exception during template processing. That exception is printed in the debug log. Are you running in debug mode? Are you seeing exceptions of any kind?
chaley is offline   Reply With Quote
Old Yesterday, 02:43 PM   #10
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
I'm running in debug mode. I'm not getting any exceptions, just a broken subtitle.
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:47 PM   #11
chaley
Grumpy old git
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: 9,414
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
Quote:
Originally Posted by ownedbycats View Post
I was able to view the full subtitle on the Kobo itself by going into book details

Code:
PLUGBOARD TEMPLATE ERROR Formatter: Failed to scan program. Invalid input }') fi near '{#fanficcat'
This says that the template has a syntax error. Have you posted exactly what is in the subtitle option?
chaley is offline   Reply With Quote
Old Yesterday, 02:48 PM   #12
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
Here's a picture of my Kobo showing the broken subtitle. Apologies for the blur, it's hard to hold the phone steady.
Attached Thumbnails
Click image for larger version

Name:	broken subtitle on kobo.jpg
Views:	11
Size:	235.4 KB
ID:	183746  
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:48 PM   #13
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
The subtitle is either supposed to show the current reading list or whatever the #fanficcat is. If it's neither of those two it should show nothing.

This is the template. It shows no error in the editor.

Code:
program:
	if field('#readorder') then
		 template('Reading List: {#readorder} #{#readorder_index:0>2s}')
	else
		if field('#fanficcat') then
			template('{#fanficcat}')	
		fi
	fi
Could it be a bug in the KoboTouchExtended drivers?
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:51 PM   #14
ownedbycats
Wizard
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.
 
Posts: 1,181
Karma: 345192
Join Date: Oct 2018
Device: Kobo Aura HD
When I put the template as a test composite column, the same book shows no error.
ownedbycats is online now   Reply With Quote
Old Yesterday, 02:56 PM   #15
chaley
Grumpy old git
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: 9,414
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
there are spaces or a tab after the right paren on the line
Code:
			template('{#fanficcat}')
Try removing them. I have no idea why this would matter, but ...
chaley 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
Multiple regexes in "save book to disk" template? Phssthpok Library Management 1 07-12-2018 05:20 AM
"Add a book" template like "Save to disk"? vr8ce Library Management 10 06-09-2017 09:16 AM
Kindle newbie needs "template" HTML & CSS Rich_H Kindle Developer's Corner 12 09-11-2012 12:16 AM
Kindle Newbie needs "template" HTML & CSS Rich_H Workshop 4 09-10-2012 09:33 PM
Kindle DX optimal "page" size - PDF or Word template guiyoforward Amazon Kindle 12 09-28-2010 08:05 PM


All times are GMT -4. The time now is 10:16 PM.


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