[Enhancement] Tag Mapper addt'l options - 4

Bug #1703142 reported by JP
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
calibre
New
Undecided
Unassigned

Bug Description

4 REQUESTS regarding Tags - quick summary here, details below.
1)Additional actions triggered by rules to include ADD, Append, Prepend, and IGNORE.
2)TAGS database export
3)TAGS editor modifier when in use with the Tags Mapper.
4)Single Tags filter list ruleset update to apply to all uses.

I've done my best to clearly and efficiently explain each, but if you need pics to better illustrate, just let me know. NOTE/EDIT: As I typed I set my tag examples apart without additional symbols, but I see after saving this report that it removes additional spacing making it potentially unclear. In edit mode, however, it is obvious. Let me know if there is anything I can do to improve this report as my layout was intended to make it as easy for the eyes to follow as a check-list.

REQUEST 1----------------------------------------

Additional actions triggered by rules to include ADD, Append, Prepend, and IGNORE.
Current options are Replace, Remove, etc...
I've tried using variations of the existing rules and other logic to map, but it doesn't fit all or is inefficient. These options would help with this if possible.

Examples:

ADD
If tags "contain" a word such as Book or "match a pattern" such as (.*)book(?i)(.*), it will add the assigned tag.
  ** Tags: Book 2, Third Book, ...other tags... Will add ASSIGNEDTAG
  ** Result: Book 2, Third Book, ASSIGNEDTAG, ...other tags...
  ** IDEALLY, if possible, "contain" would mean the ability to use more than one word, but I haven't found that it works like that as is. Please, clarify if I'm wrong. I only know to list words separated by commas, so I may be doing it wrong. ex: "contains" book OR novella in one rule listing vs. 2.
As always, what rule applies when others may be triggered depends on which is listed first in the mapper/filter.

Append
If tags "contain" a word such as Book or "match a pattern" such as (.*)book(?i)(.*), it will append the assigned tag.
  ** Tags: Book 2, Third Book, ...other tags... Will append (a typed space)ASSIGNEDTAG
  ** Result: Book 2 ASSIGNEDTAG, Third Book ASSIGNEDTAG, ...other tags...
As always, what rule applies when others may be triggered depends on which is listed first in the mapper/filter.

Prepend
If tags "contain" a word such as Book or "match a pattern" such as (.*)book(?i)(.*), it will prepend the assigned tag.
  ** Tags: Book 2, Third Book, ...other tags... Will Prepend ASSIGNEDTAG(a typed space)
  ** Result: ASSIGNEDTAG Book 2, ASSIGNEDTAG Third Book, ...other tags...
As always, what rule applies when others may be triggered depends on which is listed first in the mapper/filter.

IGNORE
Any option whether a list or pattern or such will set the tags to be IGNORED BY SUBSEQUENT RULES.
I thought that KEEP was doing this, but I've only just realized that the subsequent order rules are changing tags I do not want changed. It is inconsistent. I've reviewed the rules listing and the logic extensively, yet I still get inconsistent results.

Example (IN ORDER as the Tag Map rules run top to bottom and supposedly repeat):
Rule: KEEP pattern (.*)SERIES:(.*)
Rule: KEEP pattern >>(.*)
Rule: KEEP pattern >-(.*)
Rule: REPLACE pattern (.*)british(?i)(.*)
       with \1 ,>-England/Britain/British/UK, \2
Rule: REPLACE pattern (.*)medieval(?i)(.*)
       with \1 ,>>Medieval/Knights Period<<, \2
Rule: REPLACE if contains Brothers
       with Modern

  **Results: Undesired Current examples:

Tag >-England/Britain/British/UK becomes multiple tags and thus creates the additional "junk" tags from what is filtered.
Resulting tags are:
       >-England/Britain/British/UK, >-England/Britain/, /UK

Tag any already filtered to become >>Medieval/Knights Period<< are changed when run in the mapper and split rather than KEEPING the pattern. This as you can see also happened with the one above.
Resulting Tags are:
        >>, >>Medieval/Knights Period<<, /Knights Period<<

Tag -SERIES: Band of Brothers
is replaced by Modern despite being a tag to KEEP based on pattern.

HOWEVER....
Tag -SERIES: British Greats of the 20th Century
stays the same seeing to follow the keep rules this time and not change it based on the british pattern rule.

This last two examples seem inconsistent in action. I recently ran the Tag Mapper on the entire library(not virtual) and had a number of KEEP items beginning with the pattern -SERIES: (which is to be KEPT) be replaced by subsequent rules due to content after the word series. However, it's not consistent as many that I know have rules triggered by that content did not replace or change despite being subsequently listed after the KEEP rules.

Does the symbol > preceding tags causing a problem? I use symbols to precede and group certain types of tags for my collection.
I did find that starting a tag with < can cause things to be overlooked so I stopped using it as a prefix or sort, but the > symbol has worked for all else unless it's affecting this mapping.
Still, that symbol as you see is not involved in the other inconsistencies.

REQUEST 2-----------------------------------------

TAGS database export
Be able to export a Tags list to a text or excel file from the Tags Manager(Category Editor-Tags), the database that is separate from the Mapper. Perhaps a button for this action from the Tags Mgr screen that list the actual tags in use (as opposed to the Mapper rules which may have eliminated tags but they still appear in that database list)
The list generated would be or be convertible to a line item list just as presented in the Tags Mgr.
I've tried this in a round about way by adding all tags to a book, then exporting with the jacket that uses the tags field. However, it cuts that off after an indeterminate number of tags (I have MANY), so exporting as text then into excel with comma delimited is still short all tags.

REQUEST 3-----------------------------------------

TAGS editor modifier when in use with the Tags Mapper.
Perhaps a checkbox or on/off button that would eliminate tags from the available list IF they are applied in ANY of the rules in the Tags Mapper.

Problem:
I don't know how this would work, but it is worth asking. The addition of the Tags Editor Button that lists everything and is searchable was a terrific addition. However, when in use with the Tags Mapper, it pulls from ALL TAGS in the Tag Mapper rules database (tag-map-rules.json).

This means that even if you've eliminated the tag from current books, yet it exists in a remove or replace rule to prevent its import in the future, it will list as an available tag in the Editor making difficult to know if you've already included it in a previous rule. This becomes particularly overwhelming and difficult to manage and fully utilize that great available/applied tags list manipulation.

REQUEST 4-----------------------------------------
Single Tags filter list ruleset update to apply to all uses.

I've asked this before, but I think it was misunderstood.

I"m coming from a point of view that uses the same exact Tag Map Ruleset for all uses in the same database. So, if I refine my ruleset (Let call it TAGRULES), then I want to to apply immediately after one action. Currently, after refining I have to then go to the remaining 3 places to LOAD the ruleset there as the changes do not show as applying, nor do they as I learned the hard way in the past.

Example:
Update TAGRULES in 1) Tag Mapper.
Then have to remember to go to:
  2) Preferences/Add Books/..Tag rules to filter...
  3) Configure Metadata download/...Tag rules to filter...

If you change the ruleset TAGRULES through any of these 3 methods, a quick box asking for applications (or just auto application and not having to load in each location) if the user wants it applied to other locations would help. I only realized this was happening when it wasn't filtering as I knew I'd set the rules while in one location thinking it applied to the ruleset everywhere.

Could there be a small series of checkboxes or a pop-up asking you the user want to apply the saved rules to these other locations?

I can't figure how it currently loads (I have no know-how in coding on this). I recently directly modified the .json file of the ONLY ruleset that exists and is currently applied in all locations. After opening Calibre assuming it would pull the changes, I found I have to again "load" that ruleset for the changes to apply. Does it not load with the database changes in order to save time in overall Calibre load/opening time?
Is there a way to change how this applies?

JP (jecilop)
description: updated
JP (jecilop)
description: updated
description: updated
JP (jecilop)
description: updated
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.