|
|
Thread Tools | Search this Thread |
02-17-2020, 12:14 AM | #1 |
Groupie
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
|
Tag a book on import with the directories in the source path of the book
Until know I have organised my books in a directory structure in the vein of
.../ebooks/fiction/fantasy/flint/Torch of Freedom.epub I now would like to move all my ebooks into a Calibre library. I know I can do this with the Add books from directories and sub-directories action. However I would like to write the names of the directories in the path of a book as tags to the book's metadata (overwriting all preset tags coming from the ebook publisher). So for the example above I would like Torch of Freedom after import to be tagged with fiction, fantasy and flint. How can I do this to all the books in this directory structure? |
02-17-2020, 12:20 AM | #2 |
creator of calibre
Posts: 44,428
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Write a script that uses calibredb add --tags=whatever book_file
https://manual.calibre-ebook.com/gen...calibredb.html |
Advert | |
|
02-17-2020, 12:38 AM | #3 |
Groupie
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
|
Thanks kovidgoyal!
One question though: When I use calibredb add to add a book are the other metadata (author, etc) still taken from the book? |
02-17-2020, 12:45 AM | #4 |
creator of calibre
Posts: 44,428
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes .
|
02-17-2020, 12:58 AM | #5 |
null operator (he/him)
Posts: 20,964
Karma: 27620690
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
FWIW: I use the GetFileName optional plugin, I have it configured to put the path of the file that creates a book into a custom column (#camefrom/Came From), see ==>> Index of plugins
I have a few saved bulk S&R regexes to do some wrangling of the file path into other columns Its a File Type plugin -- towards the end of the list. Not sure if the PI gets invoked via calibredb add command. BR Last edited by BetterRed; 02-17-2020 at 01:04 AM. |
Advert | |
|
02-17-2020, 02:22 AM | #6 |
Groupie
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
|
|
Tags |
calibre, directory structure, tag conversion, tagging |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to Import directories of ebooks | jnahman | Calibre | 5 | 03-12-2019 04:28 PM |
Multiple book versions inside directories | Gilgeam | Calibre | 7 | 06-12-2017 01:34 PM |
Import on Filename changes mid import due to book error | Vortex | Calibre | 3 | 12-05-2014 11:49 AM |
Directories and book import | JulioQc | Library Management | 3 | 05-02-2012 12:36 PM |
How do I add a single book but from multiple directories? | GoldThreader | Calibre | 17 | 12-17-2011 03:04 AM |