Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-09-2012, 09:55 PM   #16
BetterRed
null operator (he/him)
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: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
In my earlier post I wrote

Quote:
Now if you open the book folder (Book Details - Click to open) and open the zip with your archiver (DONT UNZIP IT) then you should be able to click on the .lnk file inside the zip to open the referenced folder in another Windows Explorer window.
Well that's nonsense

All you need to do is to double click the ZIP in the Book Details or Metadata panels and your archiver should open the file, then you can double click the link in the zip and your supplementary folder will open. There is no need to open the Book folder itself.

Quote:
Originally Posted by darq View Post
looks like a powerful way to circumvent the directory limitation of Calibre.
Keep the directory structure, generate a zip or html with links and then import.
This could be done by an import script. The original files never get imported. Of course, this would break many plugins that won't find the extra files. I need to study this a bit
I tested Conversion - it just reported Fail and left things alone. I don't have any books in ZIPs as such, and if I did I'd convert them to EPUB and RTF. So when I see a book with a ZIP Format I can be near certain it contains a shortcut to a supplementary folder. But its still a kludge - will it work in OS/X or Linux ??

Quote:
Originally Posted by Agama View Post
This has given me an idea. I have started on a plugin to deal with links to supplementary folders.
Agama, I would not use a solution that required me to punch in HTML file paths as suggested by theDucks, as it would require me to maintain synchronicity with the file system.

On Windows 7 NTFS at least, my short cuts in a zip will continue to work if a path changes. Windows7/WinRAR will even offer to replace the old .lnk with a new one containing the new path. This is done via the use of the ObjectID datastream in shortcut files on an NTFS drive. I don't know whether its more robust than it was on XP, where it did not always work, but its better than 'nothing' at all.

I remain of the view that an additional Column Data Type (URI) is the best approach - that would work on X/OS, Linux & Windows - and it would allow multiple references - to a workstation file, a website, an FTP server, even a WAIS server etc :lol:

But is that 'doable' in a plugin - I wouldn't have thought so, but ...

BR

Last edited by BetterRed; 08-09-2012 at 10:17 PM.
BetterRed is online now   Reply With Quote
Old 08-10-2012, 02:58 AM   #17
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
My plugin is going to be simple to start with, just to get it working, and it will not use HTML file paths. I hadn't planned on using a custom column but that might be a good idea, so I'll do some testing.
Agama is offline   Reply With Quote
Advert
Old 08-24-2012, 01:23 PM   #18
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by BetterRed View Post
Good on yer cobber, happy to test when its ready
A beta version of my plugin is now ready for testing. (I'm not sure if it should be posted in this thread or in the development forum).

The plugin is called Book Links. It has a shortcut key of Ctrl+L and has two required custom settings.


Custom Settings

(1) The filetype (= extension) to use for the links file for each book.

The same extension must be used for each link file within the library, and must be selected from supported calibre book file types. I have further restricted this to: lrf, lit, rar, rtf and txt. Choose a format which you do not use for books.

The link file is created in the library in the same folder as the book, with the same naming scheme. This ensures that calibre manages the file during library operations, (e.g. copy). This file is NOT a book. I tried non-book extensions but calibre is not aware of them, so they get lost if a book is moved to a different library.

(2) The root folder for supplementary folders.

This is used so that the structure can be relocated easily without the need to edit every book link file.

Example: C:\Folders\Books\Supp

When the custom settings are saved the plugin creates a file called booklinks.ext, (where ext is the filetype chosen in (1) above), in this root folder. This is a template for the per-book links file which gets added to the library.


Links File

The links file for each book contains two links: one for a local folder and one for a web page. The local folder is relative to the root folder defined in (2) above, so the full path to the supplementary folder is formed by adding the local folder to the root.

Example: Local Folder = Hobbit

With the root shown in (2) above, the supplementary folder would be:

C:\Folders\Books\Supp\Hobbit

No matter what extenstion is chosen in (1) the links file is always a plain text file and can be inspected with any text editor.


Plugin Buttons

Open Local Folder opens the book's supplementary folder.

Open Web Page opens the web link associated with the book, (if one is defined.)

Edit Book Links opens a dialog to allow the book's links to be edited.

Update Link File saves changes to the links.


Beta Notes

a) I have only been able to test it on Windows 7.
b) The booklinks.ext template file may be better stored in the calibre configuration folder, I'm not sure.
c) The icon is very basic.
d) Comments are absent from this version.
e) There may be redundant code.

Any questions/suggestions/comments are welcome.


As with any plugin, you should inspect the code to make sure that it contains no malware since the Python language provides full access to folders/files etc. on your computer.
Attached Files
File Type: zip ag_booklinks.zip (5.2 KB, 179 views)

Last edited by Agama; 08-24-2012 at 01:33 PM. Reason: Text formatting
Agama is offline   Reply With Quote
Old 05-02-2016, 11:58 AM   #19
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
Agama's Book Links plugin

Quote:
Originally Posted by Agama View Post
A beta version of my plugin is now ready for testing ... The plugin is called Book Links.
Hi Agama,

I'm very interested in your Book Links plugin for providing links to supplementary folders.

Have you updated it since 2012? Unsurprisingly, it doesn't seem to be working with calibre 2.56.

By the way, would the plugin still need to be restricted to calibre book file types? I seem to be able to store custom file types, e.g. ZAB files (zipped audio books, as described in this thread).

calibre 2.56 [64bit] on Windows 10 Pro
readin is offline   Reply With Quote
Old 05-02-2016, 04:35 PM   #20
BetterRed
null operator (he/him)
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: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@Agama - I somehow lost track of this thread, so I missed your post #18, and hence the existence of the PI.

BTW - one has always been able to add any file type (except .LNK) to a book folder via the Add files to selected book records option (you have to spin the file type selector to All files (*.*)), and more recently by drag/drop a file of any type into the book details panel. Calibre won't lose those files if the book is retitled or moved to another library etc. I assume there's a way to do similar from a PI.

Meanwhile I moved on to this ==>> Calibre and Evernote. Important to me was that I could use the same approach to store supplementary information for authors and books, equally important was that Evernote doesn't impose a hierarchical structure like file systems do. Thanks to chaley, a bonus for CC users is that they can view the same EN Notes from their Android devices as they do from Calibre desktop - and update the EN Notes from their devices.

I have an item on my To Do list, which is to consider moving the Evernote links I have in my Book Notes custom column to an Arbitrary Identifier. An upside would be that I could scrap the Book Notes that only have a single Evernote link (~80%). A downside would be that I would lose visibility of the EN note Title in calibre, so the link I have in the King Lear Book Note would appear as "Evernote", whereas now it appears as "Kurosawa's Ran". Another downside is that it wouldn't dispense with the Evernote links in Book Notes where there's more than one link.

I think I just convinced myself to leave things as they are - I put a high value on having a consistent approach, avoids having to remember why exceptions even exist.

Let me know here, or via a PM If you want me to move post 18 onwards into a new thread in the plugins subforum - [GUI Plugin] Book Links - then if you wanted to, we can put it in the index and make it 'official'.

@readin - thanks for bumping the thread

BR

Last edited by BetterRed; 05-02-2016 at 04:38 PM.
BetterRed is online now   Reply With Quote
Advert
Old 05-11-2016, 10:08 AM   #21
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
I made a couple of small changes to Agama's Book Links plugin, and now it installs an icon on the toolbar in calibre 2.56 [64bit]. I have attached the revised plugin as 'Book Links.zip'.

However, clicking the Book Links icon produces the following error:

Quote:
AttributeError:'LibraryDatabase' object has no attribute 'construct_path_name'

calibre, version 2.56.0
ERROR: Unhandled exception: <b>AttributeError</b>:'LibraryDatabase' object has no attribute 'construct_path_name'

calibre 2.56 [64bit] embedded-python: True is64bit: True
Windows-8-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', '8', '6.2.9200')
Python 2.7.9
Windows: ('8', '6.2.9200', '', 'Multiprocessor Free')
Successfully initialized third party plugins: Book Links
Traceback (most recent call last):
File "calibre_plugins.book_links.ui", line 34, in show_ui
AttributeError: 'LibraryDatabase' object has no attribute 'construct_path_name'
I would be most grateful for any help in getting the plugin working.

calibre 2.56 [64bit] on Windows 10 Pro
Attached Files
File Type: zip Book Links.zip (5.3 KB, 129 views)
readin is offline   Reply With Quote
Old 05-28-2016, 05:00 PM   #22
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
Just to follow up, the Book Links plugin is currently defunct (see this thread).

Instead, I will be using Windows shortcuts for supplementary information (with thanks to Joanna for the idea).

For each book, you can add a shortcut to a folder on your computer. Drag & drop the folder into the Book Details pane, which adds the shortcut as a "LNK" format, and then click on the "LNK" to open the folder.

Note: Even if the folder is moved, Windows can repair the shortcuts automatically. (And if not, this Google search can probably help.)

calibre 2.57.1 [64bit] on Windows 10 Pro
readin is offline   Reply With Quote
Old 06-01-2016, 07:20 AM   #23
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Sorry folks, this plugin only ever reached beta and has not been touched for many months as it didn't seem to be going anywhere. I'm not so regular in the forum these days as calibre has developed so much that most of my plugins are now redundant.

It did work well under the release of calibre at the time and could probably be updated if there is any use for it.
Agama is offline   Reply With Quote
Old 06-12-2016, 04:07 PM   #24
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
Creating a folder shortcut by drag & drop stopped working

Since my previous post, I upgraded from calibre version 2.57.1 to version 2.58, and now when I drag & drop a folder from Windows Explorer into the Book Details pane, calibre is no longer adding a shortcut to the folder as a "LNK" format.

Is anyone else having this problem?

calibre 2.58 [64bit] on Windows 10 Pro
readin is offline   Reply With Quote
Old 06-12-2016, 05:57 PM   #25
BetterRed
null operator (he/him)
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: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by readin View Post
Since my previous post, I upgraded from calibre version 2.57.1 to version 2.58, and now when I drag & drop a folder from Windows Explorer into the Book Details pane, calibre is no longer adding a shortcut to the folder as a "LNK" format.

Is anyone else having this problem?

calibre 2.58 [64bit] on Windows 10 Pro
@readin - Are you sure calibre created .LNK files in version 2.57.1

I just tried it here - dragging a folder to book details doesn't create a .LNK for me - in calibre 2.52 (portable), 2.57.1 (32 bit) or 2.58 (64 bit) - it does nothing.

If I want a folder (or file) shortcut in calibre, I create it on the desktop via right click New->Shortcut, drag the resultant .LNK file into the book details, and then delete the .LNK file from the desktop.

Of course I might have missed something - tweak, env var

BR
BetterRed is online now   Reply With Quote
Old 06-12-2016, 09:26 PM   #26
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,864
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre has never created shortcuts to folders
kovidgoyal is offline   Reply With Quote
Old 06-12-2016, 09:41 PM   #27
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
Quote:
Originally Posted by BetterRed View Post
@readin - Are you sure calibre created .LNK files in version 2.57.1
BetterRed:

Well, I was sure, but now I'm second-guessing myself...

I only tried it a couple of times, and that was two weeks ago, but I don't remember having to create a shortcut first -- I just remember dragging the folder directly.

In any case, thanks for checking.

calibre 2.58 [64bit] on Windows 10 Pro
readin is offline   Reply With Quote
Old 06-12-2016, 09:43 PM   #28
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
Quote:
Originally Posted by kovidgoyal View Post
calibre has never created shortcuts to folders
kovidgoyal:

Okay, thanks for confirming that for me.
readin is offline   Reply With Quote
Old 06-13-2016, 02:51 AM   #29
BetterRed
null operator (he/him)
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: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@readin - I suspect you created a .LNK in place by right clicking the folder and selecting Create Shortcut, and then you DnD'd that .LNK file into the Book Details. The reason I create them on the desktop is because it gets cleaned at end of day.

If I created them in place I'm likely to leave them there gathering dust and inviting future confusion as in - 'what the **** is that doing there?'

BR
BetterRed is online now   Reply With Quote
Old 06-14-2016, 06:57 AM   #30
readin
Enthusiast
readin is on a distinguished road
 
Posts: 25
Karma: 50
Join Date: Apr 2016
Device: calibre
Quote:
Originally Posted by BetterRed View Post
The reason I create them on the desktop is because it gets cleaned at end of day.
Thanks, BetterRed, that's a very helpful suggestion.
readin is offline   Reply With Quote
Reply

Tags
import library


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Privacy of Material? bayside94 Barnes & Noble NOOK 4 12-26-2010 10:54 PM
copyrighted material GaylaM General Discussions 53 09-28-2010 12:58 PM
Reference Material Kumabjorn General Discussions 11 07-12-2010 09:26 AM
Video material of A81 kathy6699 Alternative Devices 8 02-23-2010 04:19 AM


All times are GMT -4. The time now is 03:51 AM.


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