Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-18-2016, 05:50 AM   #1
Terisa de morgan
Wizard
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 3,455
Karma: 3212558
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Mini, Kobo Aura HD, elephone, iPad, Galaxy Tab3 8
[FileType Plugin] GetFileName

This plugin allows you to store the name of your imported file in a custom column.

Special Notes:
  • Requires calibre 2.49.1 or later
  • Based on the way it works, it only stores the name when a new book is added to the library, not when a file is added to an existing book.
  • No menu or toolbar entry. Customization is accesed through Preferences -> Plugin

Installation Notes:
  1. Download the attached zip file and install the plugin/restart Calibre/configure the custom column from Preferences -> Plugins

Configuration Notes:
  • It needs to be configured for each non-virtual library when it wants to be used (no problem if not configured)
  • The column name can be different across libraries
  • If extension column is not fulfilled, filename is not split in basename and extension.

Version History:

Spoiler:
Version 0.0.4 - 25 Sep 2016
Name and extension can fulfill different columns
Version 0.0.3 - 20 Sep 2016
Name not fulfilled when adding an empty book
Version 0.0.2 - 19 Sep 2016
Comments column accepted as valid destination
Version 0.0.1 - 18 Sep 2016
Initial release
Attached Files
File Type: zip GetFileName.zip (10.7 KB, 92 views)

Last edited by Terisa de morgan; 09-25-2016 at 06:57 AM.
Terisa de morgan is online now   Reply With Quote
Old 09-21-2016, 12:44 PM   #2
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 226
Karma: 1470058
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!
fidvo is offline   Reply With Quote
 
Advertisement
Old 09-21-2016, 03:37 PM   #3
Terisa de morgan
Wizard
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 3,455
Karma: 3212558
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Mini, Kobo Aura HD, elephone, iPad, Galaxy Tab3 8
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.
Terisa de morgan is online now   Reply With Quote
Old 09-21-2016, 04:21 PM   #4
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 226
Karma: 1470058
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!
fidvo is offline   Reply With Quote
Old 09-21-2016, 04:27 PM   #5
Terisa de morgan
Wizard
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 3,455
Karma: 3212558
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Mini, Kobo Aura HD, elephone, iPad, Galaxy Tab3 8
Quote:
Originally Posted by fidvo View Post
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?
In some cases, I've been told yes... think about DeDRM, for example
Terisa de morgan is online now   Reply With Quote
Old 09-21-2016, 06:10 PM   #6
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 7,152
Karma: 6328653
Join Date: Mar 2012
Location: NSW Australia
Device: none
Quote:
Originally Posted by Terisa de morgan View Post
In some cases, I've been told yes... think about DeDRM, for example
I suspect DeDRM creates a DRM free version of the file somewhere, maybe in the 'temporary' folder, and that file is the one that gets added to the library. I can't test because I don't have any DRM protected books - nor the plugin.

Autoadd works OK

BR
BetterRed is offline   Reply With Quote
Old 09-21-2016, 06:14 PM   #7
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 226
Karma: 1470058
Join Date: Jun 2012
Device: none
Quote:
Originally Posted by Terisa de morgan View Post
In some cases, I've been told yes... think about DeDRM, for example
I still must be missing something. I don't use DeDRM myself, but doesn't it just modify the book? Where it came from is irrelevant.

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.

fidvo is offline   Reply With Quote
Old 09-21-2016, 06:41 PM   #8
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 226
Karma: 1470058
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!
fidvo is offline   Reply With Quote
Old 09-25-2016, 06:58 AM   #9
Terisa de morgan
Wizard
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 3,455
Karma: 3212558
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Mini, Kobo Aura HD, elephone, iPad, Galaxy Tab3 8
Quote:
Originally Posted by BetterRed View Post
I suspect DeDRM creates a DRM free version of the file somewhere, maybe in the 'temporary' folder, and that file is the one that gets added to the library. I can't test because I don't have any DRM protected books - nor the plugin.
You're right. I've got both things and, when I was tested the changes, I made a mistake and the directory appeared there... not the original one, so no change of getting the initial directory.

BTW, glad it works with autoadd, because I haven't tested it (I don't use that feature).

New release added, with extension configuration.
Terisa de morgan is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 23 08-16-2016 06:53 AM
How to sort quickly books by filetype? construsol Calibre 7 05-24-2014 06:20 PM
Calibre associated with every filetype?! sej7278 Calibre 14 08-09-2011 10:36 AM
Zip Filetype Plugin? rsingley Plugins 7 02-11-2011 05:11 PM
How to register a filetype? plisken iRex 2 09-28-2009 07:16 AM


All times are GMT -4. The time now is 02:23 AM.


MobileRead.com is a privately owned, operated and funded community.