![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,208
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Write to a custom column from a Metadata Source Plugin
Hi, everyone.
Is it possible for a Metadata Source Plugin to write data to a custom column? I wish I could write the book pages to such a column, defined by the user. If possible, how should I proceed? Thanks! |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,317
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, metadata source plugins do not have this capability.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,020
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Would the Import List plugin do this (customized template) from a saved file?
|
![]() |
![]() |
![]() |
#4 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,706
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,208
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Thanks for the suggestion. I don't want to create another plugin just for that. I'll let the number of pages on the log, in case someone want to check.
Thanks! |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@thiago.eec: If you are interested in getting the page count from a site, the Count Pages plugin supports this. The current sites supported use an XPath statement to find the page count. This plus the URL template and some names are all that are needed.
|
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,208
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
I use the Count Pages plugin all the time. Nice tool. Would it be possible to add skoob.com.br to the list? I can provide you any information you need. Book URL Template: https://www.skoob.com.br/livro/{skoob_id} XPath* to pages count: Code:
info_nodes = root.xpath('//div[@class="sidebar-desc"]/text()') for info in info_nodes: * There are a lot of info on a single DIV. This is how I managed to extract each info. I'm sure you can find a better way. Take a look at the DIV: Code:
<div class="sidebar-desc"> ISBN-13: <span>9788528610390</span><br>ISBN-10: <span>852861039X</span><br> Ano: 2003 / Páginas: 224<br> Idioma: português <br> Editora: <a href="/editora/1-bertrand-brasil">Bertrand Brasil</a><br> </div> Last edited by thiago.eec; 06-13-2019 at 05:35 PM. |
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,208
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I did have a look at this on the weekend. I was trying to work out a good way to handle the need for the regex. I have an idea, but probably won't have a chance to look at it until next week. If it doesn't work, your solution is simple and will work.
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,208
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Good to know! If you have another solution without regex, I'll use it on Skoob Books plugin either, since I use regex for other cases like this.
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I was looking for one without regex, but couldn't find it. What I was planning was to add the regex in the site configuration. And then run it on the XPath result. Not really much different from yours, but, it means all the changes to add a new site are in one place.
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I have just released a beta of the Count Pages plugin that adds Skoob as page count source site. I have added a, hopefully, generic way to handle the need for a regex on the result of the XPath used to find the page count. I haven't done much testing, but it seems to work for the few books I have added from the site. It is at the end of the Count Pages thread.
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,208
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Thank you very much, @davidfor!
|
![]() |
![]() |
![]() |
Tags |
custom column, metadata source, plugin |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Metadata Source Plugin] Moly.hu | kloon | Plugins | 83 | 05-23-2025 12:54 AM |
How to write a Metadata plugin | modnar_wylde | Plugins | 4 | 11-25-2018 08:38 PM |
Add Read/Unread metadata from custom column to metadata jacket | allanahk | Library Management | 4 | 11-12-2018 03:10 PM |
Plugin or custom column to show GB size of book | mom34spartan | Plugins | 5 | 07-08-2013 09:07 AM |
Write custom column from Python | nsomlai | Calibre | 7 | 11-02-2010 11:12 AM |