10-24-2009, 04:16 PM | #1 |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
Help with adding books please
Ok I am trying to add my books which I have in my own file and folder system to calibre.
I can add them however I think I can do better! eg at the moment the author and title are ALWAYS the wrong way round, and the series data gets messed up. I can see why calibre does this but cant work out how to change it... So here is how my books are named there are unfortunately a couple of variables.. Author - Series - Series2 - Booktitle Series options are not always there so sometimes will just be Author - BookTitle and sometimes it will be Author - Series - Title The reason a series2 text may be there is if say a book is part of a series within a series eg the death novels within the discworld would be Terry Pratchett - Discworld - Death 01 - Mort here are a few examples David Gemmell - Drenai 01 - Druss 01 - Legend Dean R. koontz - Velocity Eoin Coifer - Artemis Fowl 01 - Artemis fowl I have tried within Calibre preferences to alter the 'regular expression' under add books but dont really understand it and pressing test does nothing? Thanks for any suggestions. |
10-24-2009, 04:29 PM | #2 |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
Ok I had a look around and found this
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? which does pretty much everything I want But the title is getting messed up eg Eoin Coifer - Artemis Fowl 01 - Artemis fowl gives the book a title of 'artemis' everything else is spot on. hmm puzzled? and Eoin Coifer - Artemis Fowl 02 - The Artic Incident gives me a title of 'The Artic' Last edited by stustaff; 10-24-2009 at 04:33 PM. |
Advert | |
|
10-24-2009, 05:07 PM | #3 |
creator of calibre
Posts: 44,505
Karma: 24495778
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
replace the series bit with
(?P<series>[^_0-9 -]*) |
10-24-2009, 05:43 PM | #4 |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
Thanks Kovid all sorted.
|
10-24-2009, 06:03 PM | #5 |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
spoke too soon
these style are causing me problems STAR TREK - TNG - 01 - Ghost Ship_624 which works ok but Id like to be able to remove the '_624' also STAR TREK - DS9 - 01 - Emissary_512 gives me a series entry of 'DS [9]' rather than series 'DS9 [1] Im happy with 'Star Trek' as the author as I dont have the author in the filename Also I have another series that looks like 'Star Wars - _New Jedi Order 01_ - Vector Prime (by R A Salvatore)_937' gives me a title of '_New Jedi Order 01_ - Vector Prime (by R A Salvatore)_937' and star wars as the author. I'd like in this style 'star wars' as a tag and it to pull the author from between the (by **) |
Advert | |
|
10-26-2009, 04:00 PM | #6 |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
Is there an idiots guide to this stuff somewhere so i can read up to try and fix the above?
Thanks |
10-26-2009, 04:13 PM | #7 |
creator of calibre
Posts: 44,505
Karma: 24495778
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Not quite an idiots guide, I'm afraid. Basically, you have to learn to use regular expressions. Here's a guide to regular expressions
http://docs.python.org/library/re.html |
10-27-2009, 09:39 AM | #8 | |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
Quote:
I have had a go though but havent had chance to test. what does anyone think of the chances that this would work for the following file name,types. STAR TREK - DS9 - 01 - Emissary_512 STAR TREK - TNG - 01 - Ghost Ship_624 (?P<author>[^_-]+) -?\s*(?P<series>[^_-]*)\s*-\s*(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_]+) ? |
|
10-27-2009, 12:52 PM | #9 |
creator of calibre
Posts: 44,505
Karma: 24495778
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can test it using the calibre preferences dialog. Just enter the expression and the filename and click test
|
10-27-2009, 01:29 PM | #10 | |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
Quote:
When I press test nothing happens? I am using OSX on a mac mini core duo- latest version of calibre. |
|
10-27-2009, 01:33 PM | #11 |
creator of calibre
Posts: 44,505
Karma: 24495778
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah it's probably broken. Fix will be in next release.
|
10-27-2009, 01:34 PM | #12 |
creator of calibre
Posts: 44,505
Karma: 24495778
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just tried it, it works. Note that you test filename must have an extension
So test.epub will work test wont |
10-27-2009, 03:30 PM | #13 |
Wizard
Posts: 1,055
Karma: 2110
Join Date: Nov 2007
Location: Derbyshire UK
Device: sony reader PRS505 and 600
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding properties to books | IzzyMad | Workshop | 3 | 10-15-2010 12:05 PM |
Adding PDF books | Sweetpea | Calibre | 15 | 09-21-2010 01:03 PM |
Adding new books problem | Flub | Calibre | 6 | 12-24-2009 12:39 PM |
Problems adding books in 0.6.5 | lalawe | Calibre | 8 | 08-11-2009 01:46 PM |
Error adding books | Gfinch | Calibre | 2 | 08-03-2008 09:36 PM |