|  03-17-2025, 12:06 PM | #16 | ||
| Bookish            Posts: 1,049 Karma: 2006208 Join Date: Jun 2011 Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11 | Quote: 
 Quote: 
   What I meant is this: when our template code is parsed and it evolves into a not-situation (no non-ASCII code, or no title present), then the remainder of the template code on the same code line is not further processed, and immediately the next line is processed. So when the IF statement is FALSE, any ELSE statement (when present) is executed. I noticed this behavior when I made a mistake in the IF part and it was not noticed until I had a title which did happened to have a non-ASCII character and only then triggered the formatter on the error. Last edited by DrChiper; 03-17-2025 at 12:10 PM. | ||
|   |   | 
|  03-17-2025, 12:38 PM | #17 | |||
| Grand Sorcerer            Posts: 6,686 Karma: 12595249 Join Date: Jun 2009 Location: Madrid, Spain Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 | Quote: 
 Quote: 
  Quote: 
 | |||
|   |   | 
|  03-17-2025, 12:50 PM | #18 | ||
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | Quote: 
 Code: '1' || print('foo')Code: '1' && print('foo')Quote: 
 Code: program: # These two lines depend on evaluation being left to right so the # variable is set before use. title_neq = (t = $title) != transliterate(t); authors_neq = (a = $authors) != transliterate(a); # This code works because given two booleans the "truth table" has four entries. # The order of evaluation is important. As it is we can avoid extra tests because # if the first test isn't true then one or both of title_neq and authors_neq # must be false. That is why the second and third line don't need to check the # other variable. The switch_if function does shortcutting. switch_if( title_neq && authors_neq, 'true1, true2', title_neq, 'true1', authors_neq, 'true2', 'false') Code: program: title_neq = (t = $title) != transliterate(t); authors_neq = (a = $authors) != transliterate(a); switch_if( # True if both are false !(title_neq || authors_neq), 'false', # True if both are true title_neq && authors_neq, 'true1, true2', # Here, one but not both of title_neq and authors_neq is true. title_neq, 'true1', # title_neq was false so authors_neq must be true. 'true2') | ||
|   |   | 
|  03-17-2025, 01:44 PM | #19 | 
| Bookish            Posts: 1,049 Karma: 2006208 Join Date: Jun 2011 Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11 | |
|   |   | 
|  03-17-2025, 02:13 PM | #20 | ||
| Bookish            Posts: 1,049 Karma: 2006208 Join Date: Jun 2011 Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11 | 
			
			Right. I knew its behavior, but can't remember whether I have heard this name before. Quote: 
 Quote: 
  Yes, I was looking to something similar, but was to lazy to RTFM (I do just occasionally some small coding effort within calibre, when the need arises that is) Well the Template Catalog Plugin seems interesting (I had indeed asked myself how to control all those templates defined at various places) but this might help a lot. Perhaps now a description about the do's and don't's of template creation, anybody? | ||
|   |   | 
|  03-17-2025, 02:24 PM | #21 | 
| Grand Sorcerer            Posts: 6,686 Karma: 12595249 Join Date: Jun 2009 Location: Madrid, Spain Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 | |
|   |   | 
|  03-17-2025, 07:32 PM | #22 | |
| want to learn what I want            Posts: 1,679 Karma: 7908443 Join Date: Sep 2020 Device: none | Quote: 
 I have also adjusted some custom icons that were not properly referenced, hope you folks like it. | |
|   |   | 
|  03-18-2025, 04:49 AM | #23 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | Quote: 
 Plugin removed, they seem to be back. Added: Manage Categories is a core calibre feature, IMO we don't need another one BR Last edited by BetterRed; 03-18-2025 at 05:00 AM. Reason: Added: | |
|   |   | 
|  03-18-2025, 12:46 PM | #24 | |
| want to learn what I want            Posts: 1,679 Karma: 7908443 Join Date: Sep 2020 Device: none | Quote: 
 | |
|   |   | 
|  03-18-2025, 05:39 PM | #25 | 
| Grand Sorcerer            Posts: 6,686 Karma: 12595249 Join Date: Jun 2009 Location: Madrid, Spain Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 | 
			
			Is still necessary to uninstall the previous version or we can just add it now?
		 | 
|   |   | 
|  03-18-2025, 05:48 PM | #26 | 
| want to learn what I want            Posts: 1,679 Karma: 7908443 Join Date: Sep 2020 Device: none | 
			
			On a quick test I made by installing the previous version, then installing the latest one, I saw the shortcut I had set manually for this new version take effect. So I think you may safely install over previous version without uninstalling it.
		 | 
|   |   | 
|  03-18-2025, 11:16 PM | #27 | 
| want to learn what I want            Posts: 1,679 Karma: 7908443 Join Date: Sep 2020 Device: none | 
			
			Version 1.5 - fixes an issue where description info wouldn't refresh
		 Last edited by Comfy.n; 03-18-2025 at 11:18 PM. | 
|   |   | 
|  03-22-2025, 06:12 AM | #28 | 
| want to learn what I want            Posts: 1,679 Karma: 7908443 Join Date: Sep 2020 Device: none | 
			
			Uploaded version 2.0! 
 | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [GUI Plugin] Manga plugin | mastertea | Plugins | 7 | Yesterday 12:13 AM | 
| [GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM | 
| [GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM | 
| [GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |