06-29-2013, 05:17 AM | #1 |
Zealot
Posts: 132
Karma: 1070185
Join Date: Mar 2013
Location: Italy
Device: Kobo Aura HD
|
Am I doing it right?
Hello, everyone, I hope someone can help me with a small problem re custom columns/plugboards/template language
This is what I wanted to do: As I'm using eBooks reader app (same as bluefire reader) on my 1st gen iPod Touch to read, I needed to do something that would make me see the series on the title, because there's no series sorting/info there, so following instructions here on MR (general metadata part) I did this (and it worked, keep reading ! ): created custom column: Code:
lookup name: initials column heading: initials column type: column built from other columns template: {series:re(([^\s])[^\s]+(\s|$),\1)} Code:
lookup name: shortened column heading: shortened column type: column built from other columns template: {series:shorten(4,-,4)} Code:
{series:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title} - {authors} and I put this: Code:
{series:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title} Now, it seems like it's working, so when I save an Epub to disk I have it neatly as PFRWibo [16] Ink and Honour - moonblossom.epub because it's book 16 of the "Prompt Fills, Remixes, Works inspired by others" series and also when I drag and drop it to the documents folder of my reader app it shows as "PFRWibo [16] Ink and Honour" which is awesome. I have only a few problems with determinate shortened / initials series names, like, for instance: (yes yes it's all in my sherlock fanfic library) ^_^ 1) Sherlock: With A Thousand Lies (And A Good Disguise) becomes initials: SWA TL(A GD shortened: Sher-ise) 2) Sherlock and Mycroft - early years initials: SaM- ey shortened: Sher-ears 3) This is where I began initials: TiwI b shortened: This-egan 4) El sueño de la razón (The dream of reason) initials: Esdlr(dor shortened: El s-son) 5) A Cure for Boredom Universe initials: A CfBU shortened: A Cu-erse and so on, so, the problem is for a) single letters and symbols like "A" "I" "-" because they then have spaces after them (like "A CfbU") b) parenthesis that are treated like part of the next or previous word (like: "Esdlr(dor" is there a way to fix this? a way to have, for instance, for the initials: 1) SWATL(AAGD) 2) SaM-ey 3) TiwIb 4) Esdlr(Tdor) 5) ACfBU and the likes? (as for the shortened version, I can live with small imprecisions, nevermind) I should mention that the instructions here had another custom column to build first, that was the strip_series one, so that we could avoid the various "The" "A" "An" words when building the initials and shortened versions, BUT I've always wanted to keep them, I don't like when series/titles are "Cure For Boredom Universe, A" … I hate it. Probably because it's not my first language, and when I think of a title, I start with the "A" part :P So, I tweaked my calibre to my likings and put "strictly alphabetic" in Control formatting of title and series when used in templates and also in the library display. So when building the custom colums, I skipped that first strip series one and only did the other 2, putting "series" instead of "stripped series" and as I said, it works. I only have those small problems Anyone knows how to do this? I was only able to reach this far because of the detailed instructions, I don't understand this language very much Thank you and thank you Kovid (& everyone working on it) for Calibre, it totally changed the way I read and made it much better and easier to organize and keep track of things. And I can customize it so much, I changed the date display, use multiple colors, created custom columns, use plug-ins, nested tags, edit the TOC, polish books, convert books (now even docx, that was lovely), use the virtual libraries a lot, and multiple libraries... and I've barely scratched the surface, right? I love it. It's going to make me coffee next I'm sorry for the vague title, but I didn't know if this was pertinent to plugboard, custom columns, template language... or what |
06-29-2013, 07:40 AM | #2 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
Personally, I would create a custom column (#ser_initials) and enter the specific name that I want when Saving to Disk. No processing involved. You can control exactly what appears (capitalization, symbols, grouping, etc). Once set, the initials are permanent.
I'm not enough of a RegEx guru (the commands you're using as the 'template' in Code sections 1&2) to help you further. But Code 1's template would be the start to automatically capturing the series initials with the Edit Metadata in Bulk's Search & Replace feature. You would need to tweak it further for capturing and then storing the value into ser_initials. This would fill the ser_initials custom column with your current, incorrect names... but would save you from lots of manual data entry. Then you could use Edit Series:ser_initials, to fix any errors (like "(Esdlr(dor" being corrected to "Esdlr(Tdor)") for all books with the same series initials at once, and you're good to go thereafter, permanently. I cannot speak to which of these two methods (your plugboards or my custom column approach) is better or more efficient. I think (no proof!) Plugboards would take more CPU processing cycles while the custom column takes up disk and memory space. But, ATM, I'm using an older, slower PC and CPU cycles are more of an issue for me. Of course, YMMV. |
Advert | |
|
06-30-2013, 03:41 AM | #3 |
Addict
Posts: 206
Karma: 547516
Join Date: Mar 2008
Location: Berlin, Germany
Device: KObo Clara, Kobo Aura, PRS-T1, PB602, CyBook Gen3
|
Hi glos,
the problem in your initial regex is, that it only matches words with at least two letters. Therefore 'A ' is not caught and not changed. You could try to change the '+' in [^\s]+ to '*'. Then it should catch single letter words, too. Please, be careful and try it out locally first. |
06-30-2013, 05:24 AM | #4 | ||
Zealot
Posts: 132
Karma: 1070185
Join Date: Mar 2013
Location: Italy
Device: Kobo Aura HD
|
Quote:
I'll first try to keep it automatic if I can, but If I'm I'll def try your option ah I'm using a 2007 macbook that is still mostly fine, I'm not having big troubles when using calibre, i've only got 3000 or so books on it and even with all the tweaks and custom columns I'm not feeling it slow or anything Quote:
I just tried this, and you're right! I tried it on a "test" library with those few example books that needed fixing.. It did fix the space problem so now I got "TiwIb" "SaM-ey" "ACfBU" etc. The parenthesis problem is the one remaining but I guess I can live with it, it's not like I have thousands of series with parenthesis... Thank you for your help! (both of you) ^_^ |
||
06-30-2013, 07:33 AM | #5 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
You're very welcome, Glos. If any other issues come up, ask and someone will try to assist.
And thanks Sunlite for correcting the regex - I know just enough to get myself into trouble! |
Advert | |
|
07-08-2013, 11:22 AM | #6 |
Zealot
Posts: 132
Karma: 1070185
Join Date: Mar 2013
Location: Italy
Device: Kobo Aura HD
|
Here again (not sure if I am doing the right thing in using my old thread to ask this, but..)
is there a way to edit the "column type" of a custom column? I wanted to change it from "text, column shown in the tag browser" to "comma separated text, like tags, shown in the tag browser" in my Collection column, but it seems I can't do it? (the drop down menu doesn't appear) I guess the only solution is to delete the column and create a new one, losing the data? thanks |
07-08-2013, 11:33 AM | #7 | |
Wizard
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
|
Quote:
Helen |
|
07-08-2013, 11:34 AM | #8 | |
Well trained by Cats
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Use Bulk Metadata edit, Search and replace to copy the values to the new column. Once you are happy: delete the OLD column |
|
07-08-2013, 11:48 AM | #9 |
Zealot
Posts: 132
Karma: 1070185
Join Date: Mar 2013
Location: Italy
Device: Kobo Aura HD
|
@Helen & @theducks
Oh that is clever I'm trying with a few books in my test library (first time I use the bulk edit) and it seems to work, by simply doing this *I hope it's the right method!* |
07-08-2013, 01:51 PM | #10 |
Well trained by Cats
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
If it works, you must be doing it right
Just checking, when you apply, the new column does get populated correctly? I would have expected to have to also enter values: Search: (.+) Replace \1 I would remove the tick for Case sensitive |
07-08-2013, 02:15 PM | #11 |
Zealot
Posts: 132
Karma: 1070185
Join Date: Mar 2013
Location: Italy
Device: Kobo Aura HD
|
when I apply (still in my test library with OLD column not yet deleted) I get all the collections properly divided as if they were tags, and not all together as a text what would your values do? I just didn't know what to put so I tried with blank first, I was lucky it worked |
07-08-2013, 02:57 PM | #12 | |
Well trained by Cats
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I guess there is an implied 'all' default already in place Calibre can be complex (specially where you were working), We discover things that the developers thought we knew (or we miss in the update list ) Work Right is what counts |
|