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 04-12-2011, 04:59 PM   #1
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
Multiple comma separated values in composite column?

Would it be possible to have a way to get a composite column to be treated like tags?
The most important thing that I'm pretty sure I can't get to work unless there is a code change, is for it to display like tags in the tag browser.
Other stuff this might include, but that might be doable by applying the right template functions is to sort the comma separated entries (for display in the browser) and get rid of duplicates.

Last edited by silentguy; 04-12-2011 at 05:32 PM. Reason: Mixed up custom with composite
silentguy is offline   Reply With Quote
Old 04-12-2011, 05:05 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
In the create custom column dialog, click the "Tags" quick create link.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-12-2011, 05:28 PM   #3
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
Ah, sorry, mixed up two words. I meant a COMPOSITE column, i.e. one generated using templates.

Essentially I want to implement something along the lines of "automatic tags" by merging tags, series, special keywords added if conditions are fulfilled, etc.
silentguy is offline   Reply With Quote
Old 04-13-2011, 03:14 AM   #4
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I would imagine you could do something like this using a custom template function. However, I don't know the first thing about those, so here's the link to the manual
Manichean is offline   Reply With Quote
Old 04-13-2011, 05:58 AM   #5
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
I already tried creating a custom template function and it almost works like a charm, it does all the merging, removing of duplicates, etc, but mow i would like a way to tell calibre to treat the result as a list of tags. I mainly notice that it does not do so in the browser on the left, I don't know if there are other places where tags get special treatment.
silentguy is offline   Reply With Quote
Advert
Old 04-13-2011, 06:18 AM   #6
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: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Composite columns are treated as "text, shown in tag browser" columns, assuming the 'show in tag browser' box is checked. There is no way to get them to be treated as "text, tags-like", columns, internally known as "is_multiple" columns.

The only workaround is to use search/replace (edit metadata bulk) to copy the value of the composite column to an is_multiple column (tags or some custom column).
chaley is offline   Reply With Quote
Old 04-13-2011, 06:35 AM   #7
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
Damn, too bad... I guess I'll add a bug report/feature request then. Not that important really, but would be nice to have and that way it'll be on the list in case anybody ever get's bored enough to implement it
silentguy is offline   Reply With Quote
Old 04-18-2011, 06:45 PM   #8
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
Thanks for fulfilling my request, it work's really nice. The only thing I noticed is that actually displaying my column in the tag browser significantly slows down loading.

With a large library (~10.000 books) it takes around 6 seconds to start calibre (with or without my column) but if i tell it to display my column, it takes around 36 seconds to load. Is it really this expensive to build the tag tree? It is there a resource leak somewhere?
silentguy is offline   Reply With Quote
Old 04-19-2011, 05:10 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: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by silentguy View Post
With a large library (~10.000 books) it takes around 6 seconds to start calibre (with or without my column) but if i tell it to display my column, it takes around 36 seconds to load. Is it really this expensive to build the tag tree? It is there a resource leak somewhere?
Yes, it really is that expensive. These columns are not really tags (and cannot be). Computing the list of tags requires:
For every book in the database:
- split the field apart into its component tags (split on comma)
- check if an individual component has been seen before. If not, add it to the tags values data structures.

For real tags fields, this happens once instead of once per book, because the individual tag values are available in the database. In your case, this means that there are 10,000 more loops.

That said, while looking at the code I did notice a few things that I could improve, so performance might get somewhat better.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool] Multi-column PDF files on 6 inch display. Taesoo Kwon PDF 99 04-09-2014 06:16 AM
Q: multi-column PDF to single column mobi format converstion auburn1975 Calibre 7 01-28-2012 06:11 PM
Can custom book data be displayed in a custom column? kiwidude Development 9 03-02-2011 05:35 AM
Multi column sort? nexus100 Calibre 1 07-11-2010 11:19 PM
Multi-column articles in PDF tdido OpenInkpot 7 06-30-2009 11:13 AM


All times are GMT -4. The time now is 11:11 PM.


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