View Single Post
Old 01-06-2016, 06:50 PM   #906
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,984
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by firefoxxy View Post
First the replace_metadata - yes, it was a typo. The stories all had "Harry Potter & Severus Snape", and after downloading and replacing metadata there was no ship at all.
Here's the story link that did not work: link
By commenting out each ships line that could effect it, I determined it's the line:
Code:
 ships=>(?:^|(?<=/))([^ ,:]+)[^/]*(?=/|$)=>\1
Looking at it for a bit (and experimenting with it longer), I think this expression is intended to generically strip each part of a ships entry down to first name only. (When using complex regexp, it's a good idea to put a comment nearby explaining what they do. For all their power regexp are not terribly readable.)

But it doesn't work with &amp; separated ships, or with ' / ' (note the spaces) separated ships. Nor does it play nicely with sort_ships:true.

Instead, use:
Code:
replace_metadata:
## strip each ships char down to first name only.
 ships_CHARS=>^([^ ]+).*$=>\1
That way you can remove a lot of the ships lines you have.

But only after getting the new test version, because along the way with figuring this out I found that ships_CHARS and sort_ships_splits didn't work together correctly. So:

New test version (direct link)

2016-01-06

- Fix so ships_CHARS and sort_ships_splits work together. Also add default sort_ships_splits that includes &amp; separated ships.
JimmXinu is offline   Reply With Quote