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 07-07-2024, 10:32 AM   #1
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Testing metadata plugboard function

I'm trying to test a metadata plugboard function for formatting author names using author_sort, but I can't see any way of testing it in the metadata plugboard dialog, and the Template Tester plugin only seems to let me process the book title.

There must be a way to do this, so I'm obviously being dim. In the meantime, the only way I can test it is to plug in my device, upload a book, unplug, check the author name, rinse and repeat, which is incredibly slow and tedious.
Phssthpok is offline   Reply With Quote
Old 07-07-2024, 01:27 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,506
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
First of all, just to be clear. (apologies if you are trying to accomplish something else)

The metadata plugboard is NOT for manipulating filenames or paths sent to the device. For that, each device (while connected) has a 'Configure' option on the Icon. That is where the FILE (path) template is adjusted

BTW My K4 saved settings in the config folder had this line (I peaked under the skirts)
Code:
# use author sort
# Use author sort instead of author
use_author_sort = False
I sorta remember there was a tickbox on the configuration screen, but I don't see it (no device handy)

Also remember that once a device has connected, that used a snapshot of the Preferences:Plugins entry at that time. Further configurations must be done with the device connected (so you can use the Icons 'Configure')

You also list you have a Kobo and a Kindle.
Those will need individual attention in both places . (There is no OSFA in device settings ) They all do things differently.

OTOH The plugboard is for trickery when the device uses internal metadata for management.

Since My K4 has no Series support, I trick the Title to prefix it with {series-index} -{title}
theducks is offline   Reply With Quote
Old 07-07-2024, 01:36 PM   #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,097
Karma: 7908993
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
By Template tester plugin do you mean the builtin template tester?

I'm not sure what you mean by "only seems to let me process the book title." Are you referring to the template tester available from the Metadata plugboard page? If so then you see "fake" information instead of actual book metadata because the current context isn't the book list.

I suggest you test the templates in the main library using the template tester. Select the books of interest, open the tester (I defined the shortcut Ctrl+Alt+T to do that), write/run your template, then check the output. Depending on the complexity of what you are doing you might want to set breakpoints to help test/debug the template.

When happy, either
  • copy the template into the clipboard and paste it into the appropriate plugboard box, or
  • close the template tester with the OK button, open the template tester in the appropriate plugboard box, then right-click and choose "Load template from template tester."
chaley is offline   Reply With Quote
Old 07-07-2024, 02:14 PM   #4
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,097
Karma: 7908993
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
For future reference: I found a way to make the template tester available from template text boxes use metadata from selected books on the library view. The changes have been submitted to Kovid.

Once this change is released you will be able to see real metadata in the template tester available on the Plugboards preferences screen.
chaley is offline   Reply With Quote
Old 07-12-2024, 03:45 AM   #5
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by theducks View Post
The metadata plugboard is NOT for manipulating filenames or paths sent to the device.
No, I'm trying to fix the authors as displayed by the device. For example, I want to drop the "Jr." from Lloyd Biggle Jr. so he doesn't get sorted under J-for-Jr. I have set author_sort to "Biggle Jr., Lloyd" which the Kindle is happy with, but the Kobo knows better

Last edited by Phssthpok; 07-12-2024 at 03:51 AM.
Phssthpok is offline   Reply With Quote
Old 07-12-2024, 03:49 AM   #6
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by chaley View Post
I suggest you test the templates in the main library using the template tester. Select the books of interest, open the tester (I defined the shortcut Ctrl+Alt+T to do that), write/run your template, then check the output.
Exactly what I was trying to do. But under the Template window there is a "Template value" panel with two columns: "Book title" and "Template value", and there seems to be no way to change "Book title" to some other column.
Phssthpok is offline   Reply With Quote
Old 07-12-2024, 08:02 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,097
Karma: 7908993
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Phssthpok View Post
Exactly what I was trying to do. But under the Template window there is a "Template value" panel with two columns: "Book title" and "Template value", and there seems to be no way to change "Book title" to some other column.
Why do you want to change that column? All it is doing is identifying which book the value is for. The "Template value" gives you the result of running the template. If you want to see the input values then temporarily add them to the result.

It is possible to see the values of the fields and variables while the template is being processed. This requires using a GPM template (program: ). There are two ways:
  • Run calibre in debug mode and use the template language "print" statement.
  • Use the template debugger. When you hit a breakpoint you can see the value of any field or variable.

FWIW: the fix mentioned in post #4 is in today's calibre release.
chaley is offline   Reply With Quote
Old 07-22-2024, 08:07 AM   #8
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by chaley View Post
Why do you want to change that column? All it is doing is identifying which book the value is for. The "Template value" gives you the result of running the template. If you want to see the input values then temporarily add them to the result.
In other words, change the thing I'm trying to test to something different from what I'm trying to test, test it and then change it back, hoping that I haven't made a mistake changing it back, such as missing a vital bracket or comma. This violates the principle that "every change should be tested".

It would be nicer if the "Book details" heading were a dropdown where I could select the column I'm trying to mutate and see the original value and the mutated value side by side.
Quote:
Originally Posted by chaley View Post
the fix mentioned in post #4 is in today's calibre release.
Hooray!
Phssthpok is offline   Reply With Quote
Old 07-22-2024, 09:46 AM   #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,097
Karma: 7908993
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Phssthpok View Post
In other words, change the thing I'm trying to test to something different from what I'm trying to test, test it and then change it back, hoping that I haven't made a mistake changing it back, such as missing a vital bracket or comma. This violates the principle that "every change should be tested".
But the output of the template is shown. If you want to see the inputs then temporarily add them to the template. Or use the debugger in General Program Mode where you can examine every column in the metadata.

That said, I will look at adding 2 columns to the template output table to permit displaying of columns in the book.
chaley is offline   Reply With Quote
Old 07-22-2024, 09:55 AM   #10
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 571
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by chaley View Post
But the output of the template is shown. If you want to see the inputs then temporarily add them to the template.
You miss my point. I want to test the thing I want to test ("here is some input, show me the corresponding output"), not a modified version of it. Otherwise when I modify it back again, I have to test it again, but I can't test it except by doing what I was doing before -- loading a book onto my device and checking that the result is correct -- because the available tools do not allow me to test it as-is, without modification.
Phssthpok is offline   Reply With Quote
Old 07-22-2024, 10:12 AM   #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,097
Karma: 7908993
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Phssthpok View Post
You miss my point. I want to test the thing I want to test ("here is some input, show me the corresponding output"), not a modified version of it. Otherwise when I modify it back again, I have to test it again, but I can't test it except by doing what I was doing before -- loading a book onto my device and checking that the result is correct -- because the available tools do not allow me to test it as-is, without modification.
You're right, I don't understand. The template tester shows the output of the template for every book selected when the tester is opened. You control which books are selected so you can see a range of inputs. The tester shows exactly what the metadata plugboard will generate and send to the device. You can look at the metadata for the selected books while the tester is open.

If what you want to do is modify book metadata (template input) even temporarily inside the tester then that won't happen.
chaley is offline   Reply With Quote
Reply

Tags
metadata plugboard, testing


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP Metadata plugboard not working valdis_vesik Library Management 1 12-13-2019 10:01 PM
Metadata plugboard problem Phssthpok Library Management 9 07-19-2018 05:08 AM
Metadata Plugboard - I don't get it... _daclaus Library Management 3 08-25-2013 01:13 PM
Metadata Plugboard IxiaAurea Calibre 1 11-05-2011 02:13 PM
metadata plugboard functions? mfaine Calibre 2 01-09-2011 06:37 AM


All times are GMT -4. The time now is 05:52 AM.


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