Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-03-2016, 10:43 AM   #1
blake98
Member
blake98 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2016
Device: none
Tag Mapper 'Contains' Issue

I thought I had tag mapper working when I tested out the rules about 2 releases ago but when I tested again, I noticed that the 'contains' for tag mapper no longer works.

for my first rule, I have
replace the tag if it 'contains' : 100, lexa with the tag : Lexa (The 100), The 100 (TV)

when I went to test the rule with '100, lexa' in tag mapper, I get '100, lexa'

when I try with just one tag and replace with another tag, it still doesn't work. can anyone else confirm if this is happening to them or have any insights?

Edit:
Currently running 2.61, Windows 7

Thanks,
Blake

Last edited by blake98; 07-03-2016 at 10:47 AM.
blake98 is offline   Reply With Quote
Old 07-03-2016, 11:07 AM   #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: 45,246
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot use commas in rules. commas are what separate tags, therefore tags will never contain commas and rules contianing commas wll never match anything
kovidgoyal is offline   Reply With Quote
Advert
Old 07-03-2016, 11:39 AM   #3
blake98
Member
blake98 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2016
Device: none
I thought with the comma, you can use multiple tags when using contain?

so if I use contain, I can say if contain tag1, tag2, replace with text1, tag2?

or it doesn't work that way? if not, is the only other solution to write a form of regex for this and use pattern matching?
blake98 is offline   Reply With Quote
Old 07-03-2016, 12:27 PM   #4
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: 45,246
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
tag rules apply to single tags, regardless of whether they are contains/regexes/whatever. You cannot make a rule that discards one tag based on whether other tags are present.
kovidgoyal is offline   Reply With Quote
Old 07-03-2016, 02:47 PM   #5
blake98
Member
blake98 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2016
Device: none
ah, ok thank you for clarifying
blake98 is offline   Reply With Quote
Advert
Old 07-03-2016, 03:17 PM   #6
blake98
Member
blake98 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2016
Device: none
Based on how contains works, if I do:

replace the tag if it contains the tag: 'Lexa' with the tag 'Lexa (The 100)'

my result is still 'Lexa'

Should that work? or I'm missing something? This is when I use the test rules button.
Do you have any insights for this?

Last edited by blake98; 07-03-2016 at 03:21 PM.
blake98 is offline   Reply With Quote
Old 07-03-2016, 11:55 PM   #7
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: 45,246
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That is indeed a bug in contains matching. Use lowercase for the contains query and it will work. i.e. use lexa instead of Lexa

https://github.com/kovidgoyal/calibr...33f331a4d91471

Last edited by kovidgoyal; 07-03-2016 at 11:58 PM.
kovidgoyal is offline   Reply With Quote
Old 07-04-2016, 09:25 PM   #8
blake98
Member
blake98 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2016
Device: none
thanks kovidgoyal!
blake98 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
About Tag Mapper mariaclaudia Calibre 5 07-05-2016 09:46 AM
How to use tag mapper on existing and new books?? blake98 Library Management 5 04-25-2016 03:49 PM
Tag Mapper: Regular Expressions, need help BookFest Calibre 2 04-17-2016 09:47 AM
Help: Tag Mapper and RegExpressions jecilop Library Management 17 04-14-2016 10:41 PM
Bug in Tag Mapper elricks Calibre 1 01-09-2016 04:04 AM


All times are GMT -4. The time now is 03:49 AM.


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