![]() |
#1 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
|
How to determine custom column type?
I've been working on an an interface plugin that enables audiobook support through M3U files, which are simple playlists for the actual audiobook audiofiles which are stored outside of Calibre.
I've got it working pretty well for my needs, but decided to clean it up sufficiently to share with the community. Part of this effort is to add the ability to define which custom columns to use for importing the various audiofile metadata (sample rate, bitrate, # files, duration, etc.) I want to be able to check that the user has configured the desired custom columns correctly. It's pretty straightforward to check and verify that a custom column exists or not, but what's the best way of making sure that the column is of the correct type (integer, floating point, text, etc.)? Looking through calibre code I've seen mention of field metadata, but I couldn't quite figure out the best way to access it. What would be the best way to check custom column type? Thanks in advance for any help! |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,892
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
![]() Each result to be configured, only presents custom columns of the correct type |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
|
Awesome, thanks, that helps. I see what they did in their get_custom_columns() routine in config.py, I'll give that a try.
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Want a custom column showing the indentifiers type | OldLincoln | Library Management | 3 | 10-09-2015 01:45 AM |
grouping does not work for custom column type ratings | comox | Calibre Companion | 2 | 09-24-2014 01:54 PM |
Use column values to determine author link template? | eosrose | Calibre | 3 | 08-24-2013 12:34 AM |
Using "Build column from other column" custom-column type | HFC3 | Library Management | 3 | 07-07-2013 03:11 AM |
HTML column type in custom meta-data. | mukoan | Calibre | 1 | 07-13-2010 08:59 AM |