Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2023, 04:57 PM   #1
Kelzan
Member
Kelzan began at the beginning.
 
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!
Kelzan is offline   Reply With Quote
Old 06-04-2023, 05:24 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: 29,818
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Look at the Count Pages Plugin configuration for storing results, for ideas.
Each result to be configured, only presents custom columns of the correct type
theducks is offline   Reply With Quote
Old 06-05-2023, 01:12 AM   #3
Kelzan
Member
Kelzan began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
Quote:
Originally Posted by theducks View Post
Look at the Count Pages Plugin configuration for storing results, for ideas.
Each result to be configured, only presents custom columns of the correct type
Awesome, thanks, that helps. I see what they did in their get_custom_columns() routine in config.py, I'll give that a try.
Kelzan is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


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


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