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 11-21-2020, 09:16 PM   #1
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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 09:23 PM.
ownedbycats is offline   Reply With Quote
Old 11-22-2020, 06:02 AM   #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,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Moderator Notice
Moved to its own thread
chaley is offline   Reply With Quote
Advert
Old 11-22-2020, 06:21 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,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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, 11:13 AM   #4
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thank you.
ownedbycats is offline   Reply With Quote
Old 12-02-2020, 01:10 PM   #5
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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; 12-02-2020 at 01:21 PM.
ownedbycats is offline   Reply With Quote
Advert
Old 12-02-2020, 01:21 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,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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; 12-02-2020 at 01:27 PM.
chaley is offline   Reply With Quote
Old 12-02-2020, 01:36 PM   #7
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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 offline   Reply With Quote
Old 12-02-2020, 01:38 PM   #8
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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 offline   Reply With Quote
Old 12-02-2020, 01:41 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,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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 12-02-2020, 01:43 PM   #10
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I'm running in debug mode. I'm not getting any exceptions, just a broken subtitle.
ownedbycats is offline   Reply With Quote
Old 12-02-2020, 01:47 PM   #11
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,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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 12-02-2020, 01:48 PM   #12
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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:	190
Size:	235.4 KB
ID:	183746  
ownedbycats is offline   Reply With Quote
Old 12-02-2020, 01:48 PM   #13
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly 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 offline   Reply With Quote
Old 12-02-2020, 01:51 PM   #14
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: 10,805
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
When I put the template as a test composite column, the same book shows no error.
ownedbycats is offline   Reply With Quote
Old 12-02-2020, 01:56 PM   #15
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,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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


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 04:20 AM
"Add a book" template like "Save to disk"? vr8ce Library Management 10 06-09-2017 08:16 AM
Kindle newbie needs "template" HTML & CSS Rich_H Kindle Developer's Corner 12 09-10-2012 11:16 PM
Kindle Newbie needs "template" HTML & CSS Rich_H Workshop 4 09-10-2012 08:33 PM
Kindle DX optimal "page" size - PDF or Word template guiyoforward Amazon Kindle 12 09-28-2010 07:05 PM


All times are GMT -4. The time now is 02:43 AM.


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