Need an import expression to use sub-foldername as series
I'm trying, as patiently as I can, to use Calibre to move my ebooks into it's library without having to spend huge effort reorganizing all of my books. Currently I have my books organized into a very logical structure (I would think most would agree) which is Author\Series\filename.xxx. For the most part the files are author - series (maybe) - title.xxx
It's possible the filename won't contain the series name and yes, the series may be in a sub-folder with the series name as well.
In short:
1. Some files will have series as the second part of the filename, some wont (just author - title.xxx)
2. Some may be in a proper series sub-folder (under the author folder). I expect to import folders by Author).
3. Some may not contain the author (maybe just series - title or just title.xx) but will be in the author folder (as all will).
Is it possible to write an expression that will:
1. Use the first subfolder found as the series.
2. Use the second phrase (found after the first - and before the second -) as the series.
3. Use the second phrase (found after the first - with NO OTHER dashes in the filename) as the title (instead of series as number 2)
4. Use the main source folder as the author
5. Use the first phrase (before the first -) as the author (if no dashes then it will be title)
6 Use the filename itself as the title if it contains no dashes.
Pretty complex, I know, but I'm hopeful. Unfortunately I don't know python and it's regular expression syntax and it looks pretty much like a pita to learn any time soon).
Thanks.
|