![]() |
#1 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Koreader: How to get metadata to device?
I'm working right now on an enhancement to add a search function to Koreader that allows a user to search for any text in any of Calibre's columns and then select a book from the list of results and open the book.
The first part works already, I can search for books and it automatically opens the first book it finds, I "just" have to work on the second part, to show the search results. I will work in the next days on that. But there is still the question, how to get the metadata on the device? I can see a few options for that. I could read the data from the build-in reader. I will not follow this way since it has a few disadvantages: First, different databases for Kobo and Kindle, and none for Android devices. Second, hidden directories. I have all my books in one of those to make sure Nickel does not see my books, so my Kobo database does not have any metadata. Another way is to use Calibre. I guess all of us use Calibre, but still there are different ways how we put our books to the device. Some will send the files to Kobo, some to Kindle, and I choose a third way by connecting my library to a folder and load all the files into this folder and copy them via robocopy to my Kobos. One way to use Calibre is to use the file .metadata.calibre that Calibre puts into the folder with your books. But this file is pretty huge and difficult to read, that's why I right now do not use this one neither. What I use is Calibre's export catalog to CSV function. I upload this CSV file to my reader and read all the necessary info out of that one. In my opinion necessary are: author, title, path to book. Once I have those it should not be a problem at all to add nearly every other of Calibre's columns, actually in my solution so far you can already use any column. But my question, is there a better way to get the metadata to the device? Something that is easy to handle for the end user? There are some problems involved in this, e.g. the path to the book. Right now I have created a column in Calibre that repeats the setting from "Send to device" ({author_sort[0]}/{authors}/{title}), but since the default setting is to also change the characters to English equivalents this becomes {author_sort[0]:transliterate()}/{authors:transliterate()}/{title:transliterate()}, and if you have more complicated settings the string here will also get more complicated. Another problem is that this way I will not find out which format the book has (e.g. epub or pdf). Right now I don't care, I just check if I find either an epub or a pdf, I probably have to enhance this by all other possible file types. Any suggestions? |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
If I remember correctly FAT has the metadata in the directory, not sure if there is any actually in the file itself. Correction it appears that, that changed with Vista. They are using the term "Properties" now and what you are looking for is under the details tab. Guess you could see if some of the data that you can see looking at the properties/details can be found using a HexEditor on the file.
OR You could copy a file, of the type you are interested in, then use the "Remove Properties and Personal Information" function and make a change to the copy's properties, then you could compare the two files and it should show were the difference occurs. Luck; Ken Last edited by Ken Maltby; 08-05-2014 at 01:41 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
No, the data I am looking for is for sure not in the file or the file properties.
Of course you could modify the file itself so the metadata become part of the epub, but again that is not a solution I would prefer, it means to modify all files and it will be slow. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Errm, you get the data by extracting the metadata from the files, I'd suggest. I think most of our file backends already have some metadata access items. Metadata typically _is_ part of the epub. Or the PDF. Or the DJVU file.
Of course, one could start another way. However, most existing readers use the metadata embedded into the document files. I'd say that is what users expect. Extracting is a bit I/O intensive, so typically, metadata extracted is cached in a database of some kind, where a relationship to the actual file is stored alongside. |
![]() |
![]() |
![]() |
#5 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Well, my idea is for sure NOT to search through the whole file system but use the data from Calibre since this is already there. And for sure the data I have in Calibre are well-kept while the data in my books are not.
My solution (CSV export from Calibre) so far works super fast, right now I'm testing if I can use the data from metadata.calibre instead since then I could avoid having to export the CSV file every time... |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 511
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
I think that the "metadata.calibre" could be much faster and easier than the 'extraction' solution.
This file (one for every storage media) have all the tags, the custom columns and the -relative to the root- path of every book. With the full filename, you also have the extension (pdf, epub ...) There could be a field (or a settings file) that the user could specify the path and the format ({author_sort[0]}/{authors} - {title}) of the library. The CSV way is also very good idea, with just one more easy step for the user. I could live with that. ;o) Because the default setting of Calibre is to change the Unicode characters to English equivalents, I 'Save to Disk' first and then copy the files to the reader by myself. |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
WS64: The metadata.calibreis an easy way to do this, but it means that a connection to calibre has to be made at some time. The file is JSON format. There are libraries around for different languages to read that. Hopefully there is one you can use.
|
![]() |
![]() |
![]() |
#8 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
I wrote my own function so far to get the data from metadata.calibre, and it still is pretty fast (right now I can get a search result back within 30 seconds for a (manipulated) calibre file with 19000 datasets.)
Just have to think of something to get back data that go over a few lines, but that won't be a big problem either. One question to that file, is the name metadata.calibre or .metadata.calibre? On my Kobos the file has the dot, on my Cybook not. Of course I can simply search for both and take the one I can find (if there is any, this solution for sure is only for Calibre user!), but I wonder what the naming conventions here are... |
![]() |
![]() |
![]() |
#9 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I have no idea why anything, but on my Kindle it is "metadata.calibre", no preceding dot.
|
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,906
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 | |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Quote:
So I check for metadata.calibre first and if not successful for the dot version, thanks! |
|
![]() |
![]() |
![]() |
#12 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
Quote:
Luck; Ken |
|
![]() |
![]() |
![]() |
#13 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 511
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Searching metadata problem
Using 485, although the search is producing results, when I click on them I get a "File does not exist" message.
My books are in "/mnt/sd/.Books" and Calibre can see them just fine. An other thing is that when I search a term in Unicode, it is case sensitive regardless of what I set in the Options. |
![]() |
![]() |
![]() |
#14 |
♫
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
Is the LIBRARY_PATH really set to "/mnt/sd/.Books"?
Manually check the metadata.calibre file in this folder for one of the books, does the lpath point to a valid book? No idea yet about the case (in)sensitive... |
![]() |
![]() |
![]() |
#15 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
Quote:
Luck; Ken |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Metadata on Device(s) | Book Reader | Devices | 6 | 06-17-2014 12:31 AM |
How to read metadata on device? | soxisoverthere | Library Management | 0 | 08-14-2013 04:22 PM |
How do I prevent custom metadata from being sent to the device? | PatNY | Calibre | 10 | 09-24-2010 06:39 AM |
Send to Device & Metadata | Bob Butler | Calibre | 18 | 02-22-2009 09:33 PM |
edit metadata on device | alexxxm | Calibre | 12 | 12-11-2008 03:23 AM |