View Single Post
Old 09-22-2012, 07:36 AM   #311
remus.grrrl began at the beginning.
Posts: 13
Karma: 10
Join Date: Feb 2011
Device: none
Metadata Plugboard not working right

Originally Posted by chaley View Post
[Edited on 23/Jan/2011]

Several people are doing interesting and useful things with templates, plugboards, and composite fields. This thread is both a request that they share what they have done and a place to put the information.

Suggestions/recipes are summarized below. Don't hesitate to post corrections and useful variants.

General Metadata

Metadata: Put series into the title, using either initials or a shortened form. Strip leading articles from the series name (any) (inspired by Gary_M_Mugford)
The solution requires creating three composite columns. The first column is used to remove the leading articles. The second is used to compute the 'shorten' form. The third is to compute the 'initials' form. Once you have these columns, the plugboard selects between them. You can hide any or all of the three columns on the library view.

First column:
Name: #stripped_series. Template: {series:re(^(A|The|An)\s+,)||}
Second column (the shortened form):
Name: #shortened. Template: {#stripped_series:shorten(4,-,4)}
Third column (the initials form):
Name: #initials. Template: {#stripped_series:re(([^\s])[^\s]+(\s|$),\1)}
Plugboard expression:
Template:{#stripped_series:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title}
Destination field: title
This set of fields and plugboard produces:
Series: The Lord of the Rings
Series index: 2
Title: The Two Towers
Output: LotR [02] The Two Towers

Series: Dahak
Series index: 1
Title: Mutineers Moon
Output: Dahak [01] Mutineers Moon

Series: Berserkers
Series Index: 4
Title: Berserker Throne
Output: Bers-kers [04] Berserker Throne

Series: Meg Langslow Mysteries
Series Index: 3
Title: Revenge of the Wrought-Iron Flamingos
Output: MLM [03] Revenge of the Wrought-Iron Flamingos

Trying to use this, however, no matter what the series is, it always uses the initials for it. I have a lot of series that are one word that keep showing up as one letter which is making it hard to figure out which series the books belong to.

ie: Both series name Bite, and Berserk....will both show

B [1] {title} I need to tweak the metadata plugboard so it will recognize that it is to use the series alone if it is only 1 word?

Help is greatly appreciated.
remus.grrrl is offline   Reply With Quote