Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 02-16-2019, 10:18 AM   #376
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by Tanjamuse View Post
If I use the Tag Rules, what happens if the fandom only has that tag?
It would get deleted if oldtag=newtag (regardless of purgetag value) so just skip tags you don't wish to change. Everything else gets replaced by the newtag.

By the way, I made a tag rules table for the LOTR tag you linked to in the FFF thread.

https://archiveofourown.org/tags/The...R*d*%20Tolkien

I think this is probably more helpful to you than my personal tag rules. I don't even wrangle fandoms since I set those manually (easy since everything is A Song of Ice and Fire at the moment).

If you still want a copy of mine, I can email it if you PM me your address (it doesn't seem like attachments are allowed in PM).


Mind, for your specific example (Assassin's Creed 3 - Fandom >> Assassin's Creed), it should have worked with Tag String Replacement. Mayhaps the old string wasn't exact (curly quotes instead of straight, extra spaces, etc)?
Attached Files
File Type: zip _js tag rules lotr.zip (38.2 KB, 172 views)

Last edited by ilovejedd; 02-16-2019 at 10:21 AM.
ilovejedd is offline   Reply With Quote
Old 02-16-2019, 10:20 AM   #377
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
I created the "Tag Scrubbing Audit Log" to document what did and did not happen and why. Copy it to the clipboard, and then add it to your post so I can examine it.


DaltonST
DaltonST is offline   Reply With Quote
Old 02-16-2019, 10:27 AM   #378
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Remember that you can use /Regular Expressions/ in some of the scrubbing rules tables, including the Tag Rules Table. Look at the example .csv file in calibre/config/plugins/jobspy/resources.

Example: "/sci.*[f][iy].*/","Fiction:Science","False"


DaltonST
DaltonST is offline   Reply With Quote
Old 02-16-2019, 10:34 AM   #379
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by DaltonST View Post
Remember that you can use /Regular Expressions/ in some of the scrubbing rules tables, including the Tag Rules Table. Look at the example .csv file in calibre/config/plugins/jobspy/resources.

Example: "/sci.*[f][iy].*/","Fiction:Science","False"
I did this initially. Unfortunately, with all the misspellings on AO3 and given its free for all nature, I found it easier to export freeform tags via SQLite Database Browser or use "synonyms" from the tag page (e.g. https://archiveofourown.org/tags/A%2...ated%20Fandoms) to do direct tag replacement.
ilovejedd is offline   Reply With Quote
Old 02-16-2019, 10:36 AM   #380
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Here's the audit log.

If I were to use the Regular Expressions with any version of Buffy The Vampire Slayer how would that go? And would it delete everything else but Buffy in the fandom?
Attached Files
File Type: txt Tag String Replace Rules Audit Log.txt (1.3 KB, 170 views)
Tanjamuse is offline   Reply With Quote
Old 02-16-2019, 11:38 AM   #381
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
As the examples show, it matches on the RE and then replaces whatever Tag is matched with the "new tag" value. Or, purges it if that is what you set.

"/.*Buffy.*Vampire.*Slay.*/","Buffy The Vampire Slayer",False

So, "/.*Game[ ]of[ ]Thrones.*/" would not match Buffy, and Buffy would not match Game of Thrones.

Your .csv files show way too many needless rules because they do not use REs at all.

You need to be developing your .csv files using a TEST Library that is a copy of your "real" Library. You just need the metadata.db, not all of the books underneath it. That way, you could refresh your TEST Library's metadata.db easily and quickly to test again. Or, create some custom columns to hold your test data column, and refresh your active custom columns from that using Bulk Edit S&R. That is what I did to develop the Tag Scrubbing tool.

Remember to compress your "real" metadata.db using Check Library after you run your rules "for real".

DaltonST

Last edited by DaltonST; 02-16-2019 at 11:45 AM.
DaltonST is offline   Reply With Quote
Old 02-16-2019, 12:48 PM   #382
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
When I run the tag rules it doesn't change the t in the from normal to Capitalized.

For example in Buffy the Vampire Slayer it's supposed to be Buffy The Vampire Slayer.

It says it does in the log, but when I look in Calibre it stays the instead of The.
Attached Files
File Type: txt Tag Rules Log.txt (4.8 KB, 164 views)
Tanjamuse is offline   Reply With Quote
Old 02-16-2019, 01:00 PM   #383
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
I do believe tags are not case sensitive. Use either the Tag Capitalization Rules or Bulk Metadata Edit S&R for that.
ilovejedd is offline   Reply With Quote
Old 02-16-2019, 02:07 PM   #384
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Version 1.0.141 Per Library tweak for title_series_sorting

Version 1.0.141 - 2019-02-16 Per Library tweak for title_series_sorting


See the explanatory image.





DaltonST
Attached Thumbnails
Click image for larger version

Name:	js_tweak_per_library_title_series_sorting.jpg
Views:	169
Size:	1.12 MB
ID:	169769  

Last edited by DaltonST; 02-17-2019 at 10:42 AM.
DaltonST is offline   Reply With Quote
Old 02-16-2019, 02:39 PM   #385
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,772
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DaltonST View Post
Version 1.0.141 - 2019-02-16 Per Library tweak for title_series_sorting
thank you

Lesson learnt: If you rename a library, don't forget to adjust your per library tweaks. I recently changed a library name from 'Main' to 'Books' and neglected to change job_spy_default_output_format and job_spy_author_sort_copy_method. In an ideal world there would be a reminder in the Library rename dialogue

BR

Last edited by BetterRed; 02-19-2019 at 03:49 PM. Reason: Added lesson learnt & punctuation
BetterRed is offline   Reply With Quote
Old 02-19-2019, 06:31 AM   #386
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
I'm looking through the rules for scrubbing tags, and I'm wondering what to do if I want to add more than one tag based on an existing tag:

Example:

Existing tag: Harry Potter - J. K. Rowling

New tag: Harry Potter, Books & Litterature

Thanks for an otherwise great tool which I hadn't noticed before.
Tanjamuse is offline   Reply With Quote
Old 02-19-2019, 09:40 AM   #387
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by Tanjamuse View Post
I'm looking through the rules for scrubbing tags, and I'm wondering what to do if I want to add more than one tag based on an existing tag:

Example:

Existing tag: Harry Potter - J. K. Rowling

New tag: Harry Potter, Books & Litterature

Thanks for an otherwise great tool which I hadn't noticed before.
Try Tag String Replacement.

Tag Rules doesn't work for creating multiple tags. It has to be 1:1.

As always, do the scrub on a test library or column.
ilovejedd is offline   Reply With Quote
Old 02-19-2019, 09:48 AM   #388
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Tag Combination Rules & Tag Splitting Rules

Actually, there is a Tag Combination Rules table for creating a new Tag from 2 or 3 existing Tags.


Quote:
"tag_keyword_1","tag_keyword_2","tag_keyword_3","n ewtag"
"Fantasy","Urban","Steampunk","Fiction:Fantasy-Urban-Steampunk"
"Romance","Vampire","NONE","Fiction:Romance-Paranormal"
"Romance","Suspense","NONE","Fiction:Romance-Suspense"
"Romance","Thriller","NONE","Fiction:Romance-Suspense"
"Romance","Werewolves","NONE","Fiction:Romance-Paranormal"
"Alpha Male","Romance","NONE","Fiction:Romance-Paranormal"
"Fantasy","Shapeshifter","NONE","Fiction:Fanta sy-Shapeshifter"
"Erótico","Romántico","Humor","Fiction:Romanti c-Erotic-Humorous"
"Fiction","Fiction:Espionage","Fiction:Other","__C omboRule_with_3"
"Fiction","Fiction:Science","NONE","__ComboRule_wi th_2"
Added: If you want to create a new Tag for only one Tag, you could use Bulk Metadata Edit to add a Tag of "__dummy__" to all Books, then create a Tag Combination Rule accordingly. Later, simply delete the dummy Tag everywhere it is found.



Added: Also: Tag Splitting Rules.


Quote:
"target","regex","split_string_1","split_string_2" ,"split_string_3","split_string_4"
"#mytaglike","^.+$","-",":","&","_"
"#mytaglike","[/]+","/","","",""
"tags","[@]+","@","^","",""
DaltonST

Last edited by DaltonST; 02-19-2019 at 10:04 AM.
DaltonST is offline   Reply With Quote
Old 02-19-2019, 10:19 AM   #389
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
I'm having better luck with Tag Rules instead of String Replacement. I may try the dummy solution or maybe I'll add the tag I need anyway and then use the splitting rules after.

Can I add any character for splitting at?
Tanjamuse is offline   Reply With Quote
Old 02-19-2019, 11:15 AM   #390
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Yes, several. See the examples in the Tag Splitting Rules .csv file example. The rule first matches using the REGEX, then if the Tag is matched, splits at any of the specified strings that it finds. It does not have to be a simple single character.

The sequence of running the various rules tables is critical. See the ToolTips.

Test it in a Test Library.
DaltonST is offline   Reply With Quote
Reply

Tags
author aka, author pen name, colors, toolbag, toolbox, tools


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 523 07-15-2025 06:45 PM
[GUI Plugin] Ex Libris AlPe Plugins 87 10-10-2020 03:10 PM
[GUI Plugin] Marvin XD Philantrop Plugins 126 01-29-2017 12:48 PM
Ubuntu/Linux : Command to schedule a job with Calibre.( No GUI ) DurgaPrasad Calibre 0 10-16-2013 06:50 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 05:46 AM.


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