09-18-2016, 06:50 AM | #1 |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
[FileType Plugin] GetFileName
This plugin allows you to store the name of your imported file in a custom column.
Special Notes:
Installation Notes:
Configuration Notes:
Version History: Spoiler:
Last edited by Terisa de morgan; 07-11-2022 at 05:37 AM. Reason: Release 0.0.13 added |
09-21-2016, 01:44 PM | #2 |
Addict
Posts: 301
Karma: 1599870
Join Date: Jun 2012
Device: none
|
This is going to be very useful. Thanks!!
If you'll indulge me for a moment, there are a couple of features that I would love to see added to this plugin. 1. An option to split the file name and extension into two columns. As it is, this allows you to see the original format of the book when it was first imported, which is great. Several people have asked for that feature. Splitting the extension into its own field would make it easier to identify these original formats in the tag browser. Also, I use a custom Title ID field in my Save to Disk template. If I could populate this field without the extension, it would work perfectly. Yes, I could run a search and replace on the books to remove the extension, but that's one more step I have to perform. 2. Save the file path in another column. Ideally it would convert the path separators "/" or "\" into periods. That way, it could populate a hierarchical field and you could use the tag browser to browse the folder structure. Even better would be to include a field in the plugin setup for a "relative path" prefix. If the file path begins with this prefix, it removes it before populating the column. e.g. if the relative path is "C:\In\Ebooks\" and the book comes from "C:\In\Ebooks\Science_Fiction\Verne_Jules\" then it would populate the File Path field with "Science_Fiction.Verne_Jules". If you decide not to add these, I'll probably dust off my old Python books and see if I can add the features to my own copy of the plugin, but I would love to see them implemented in the official version. Thanks again! |
Advert | |
|
09-21-2016, 04:37 PM | #3 |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Glad it can be useful! About your request:
* The extension extract would be feasible, and you can define the column for it (and you split the name) or not (and it's like now). * The path suggestion I don't think so, as some plugins can change the directory. I'll be back in a couple (or three days) with the first change. |
09-21-2016, 05:21 PM | #4 |
Addict
Posts: 301
Karma: 1599870
Join Date: Jun 2012
Device: none
|
Great news!
I'm not sure what you mean by plugins changing the directory. I was talking about the path to the original file. Are you saying plugins change this? e.g. if the original file is: C:\In\Ebooks\Science_Fiction\Verne_Jules\80days.ep ub then you would end up with the following custom fields filled (assuming you configured it to use those fields) #titleid: 80days #original_format: epub #original_path: C:.In.Ebooks.Science_Fiction.Verne_Jules Anyway, splitting the file name and extension will save me a lot of time when adding books to my libraries. Thanks again! |
09-21-2016, 05:27 PM | #5 |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
|
Advert | |
|
09-21-2016, 07:10 PM | #6 | |
null operator (he/him)
Posts: 21,064
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Autoadd works OK BR |
|
09-21-2016, 07:14 PM | #7 | |
Addict
Posts: 301
Karma: 1599870
Join Date: Jun 2012
Device: none
|
Quote:
I just figured that to add a book to the library, at some point Calibre has to know the path to that book in order to load the file into memory for adding to the database. Of course, that path may not be accessible to plugins. And maybe other plugins do interfere with it. If you tell me it's not possible or there are too many complications, I'll believe you. I'm still looking forward to the changes you're making. And like I said, I might see if I can modify my own copy of the plugin to add the feature. Or at least get a better understanding of why it won't work. |
|
09-21-2016, 07:41 PM | #8 |
Addict
Posts: 301
Karma: 1599870
Join Date: Jun 2012
Device: none
|
Okay, I did some research and I think I understand what you meant by plugins changing the path.
If I understand correctly, because your plugin is a kind of post-processing for books being added to the library, it doesn't have access to the original file path. By the time your plugin is triggered, the file might have been altered and either been saved to a temporary location or exists only in memory. So when you try to read the path to the file, the result is this new location or just a pointer to the memory stream. Oh well. I guess it won't work. But at least I got most of what I want, so I'm happy! |
09-25-2016, 07:58 AM | #9 | |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
BTW, glad it works with autoadd, because I haven't tested it (I don't use that feature). New release added, with extension configuration. |
|
09-27-2016, 01:30 PM | #10 |
Addict
Posts: 301
Karma: 1599870
Join Date: Jun 2012
Device: none
|
I just installed the new version, and it works great!
I took a look at the source code the other day, and I might make a custom version for myself with some more file types in it because I want to use it for my non-book libraries (I use Calibre in lots of ways it wasn't meant for), but I'm quite happy with the plugin. |
09-27-2016, 01:56 PM | #11 |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Glad it's useful! And go ahead with the modifications, I do it myself a lot of times for taylor-making a plugin.
|
09-27-2016, 06:16 PM | #12 |
null operator (he/him)
Posts: 21,064
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Terisa de morgan - I think the plugin should be file type agnostic - I can add just about any file type by dropping it into the book list, or via a shortcut to calibre.exe in my Window Send To folder. I use the latter for ~95% of things I add, and ~30% of things I add are not ebook formats.
I'd also like to see an option to save the full path, in my case it gives me a clue as to the source. At the moment I copy the path into the clipboard before I execute the 'Send To calibre', and paste it into #file in the book list. BR |
09-28-2016, 01:13 AM | #13 |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
@BetterRed - The plugin is agnostic, gets the file extension but knows nothing about type (if you see epub es because the extension is ".epub", as you would see prc instead of mobi/azw).
The plugin doesn't know the original path but the previous path, which is a temp directory if you use DeDrm plugin, for example. If, knowing that, you still want the path option, I can add it in the same way I've added the extension field. |
09-28-2016, 01:55 AM | #14 |
null operator (he/him)
Posts: 21,064
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Terisa de Morgan - I think I added an MP3 to a library where I hadn't configured the file name column
Another Under The Counter transaction I'd be happy with radio buttons - File Name Only, or Full Path - but whatever is easiest for you, including nothing, will do BR |
09-28-2016, 03:59 AM | #15 | |
Grand Sorcerer
Posts: 6,403
Karma: 12408443
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
I've never used radio buttons, I good way to learn to use them Anyway, would you want the path in another field or inside the filename field? |
|
Tags |
calibredb, calibredb metadata import, plugin |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 02:25 AM |
How to sort quickly books by filetype? | construsol | Calibre | 7 | 05-24-2014 07:20 PM |
Calibre associated with every filetype?! | sej7278 | Calibre | 14 | 08-09-2011 11:36 AM |
Zip Filetype Plugin? | rsingley | Plugins | 7 | 02-11-2011 06:11 PM |
How to register a filetype? | plisken | iRex | 2 | 09-28-2009 08:16 AM |