specify separator for composite columns

Bug #1927141 reported by capink
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Charles Haley

Bug Description

Can calibre add an additional option to specify the separator for composite columns. I have a composite column that consolidates multiple series columns into one composite column called #series_composite. The issue I am having is that some series have commas, so when calibre tag browser splits using a comma, some series get incorrectly split into two or more series.

If calibre offers me the option to specify my own separator, I can change my template to use another separator (e.g. :::)

program:list_union(field('series'), field('#series2'), ':::')

Another related issue is using the following search:

#series_composite:#>1

which returns the following error:

calibre, version 5.17.0
ERROR: Unhandled exception: <b>AttributeError</b>:'CompositeField' object has no attribute 'iter_counts'

calibre 5.17 embedded-python: True is64bit: True
Linux-4.15.0-33-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '4.15.0-33-generic', '#36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018')
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Action Chains (1, 8, 3) && Extract ISBN (1, 5, 0) && Favourites Menu (1, 0, 5) && Find Duplicates (1, 8, 6) && Goodreads (1, 5, 1) && Import List (1, 5, 5) && Manage Series (1, 2, 11) && View Manager (1, 6, 1)
Traceback (most recent call last):
  File "calibre/gui2/library/views.py", line 1354, in search_proxy
  File "calibre/gui2/library/models.py", line 497, in search
  File "calibre/db/view.py", line 275, in search
  File "calibre/db/view.py", line 310, in search_getting_ids
  File "calibre/db/cache.py", line 72, in call_func_with_lock
  File "calibre/db/cache.py", line 1086, in search
  File "calibre/db/search.py", line 931, in __call__
  File "calibre/db/search.py", line 993, in _do_search
  File "calibre/db/search.py", line 496, in parse
  File "calibre/utils/search_query_parser.py", line 365, in parse
  File "calibre/utils/search_query_parser.py", line 392, in _parse
  File "calibre/utils/search_query_parser.py", line 400, in evaluate
  File "calibre/utils/search_query_parser.py", line 449, in evaluate_token
  File "calibre/utils/search_query_parser.py", line 453, in _get_matches
  File "calibre/db/search.py", line 612, in get_matches
AttributeError: 'CompositeField' object has no attribute 'iter_counts'

Revision history for this message
Charles Haley (cbhaley) wrote :

I won't add the separator character because I have no idea what that would break, but I suspect it would be lot of things.

I am looking at the problem with count searches on composites.

Changed in calibre:
assignee: nobody → Charles Haley (cbhaley)
Revision history for this message
Charles Haley (cbhaley) wrote :

for the exception

Changed in calibre:
status: New → Fix Committed
Revision history for this message
capink (capink-eg) wrote :

Thanks.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.