View Single Post
Old 01-30-2015, 09:52 PM   #17
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Alexander Turcic View Post
@BetterRed, @davidfor, I tested importing the extra metadata via an opf file (which would be another easy solution as I could include all the extra data in the opf while extracting the attachments from the MR database), but it appears that calibre then erases part of the existing metadata.

Code:
$ calibredb add ~/mrlibrary/AlexBell/255021/134208_What\ Diantha\ Did\ -\ Charlotte\ Perkins\ Gilman.mobi   

Backing up metadata
Added book ids: 8
Notifying calibre of the change

$ calibredb show_metadata 8

Title               : What Diantha Did
Title sort          : What Diantha Did
Author(s)           : Charlotte Perkins Gilman [Gilman, Charlotte Perkins]
Publisher           : Bellware
Tags                : romance, humanism, servant question
Languages           : eng
Timestamp           : 2015-01-30T12:18:08+00:00
Published           : 2015-01-24T13:00:00+00:00
Identifiers         : mobi-asin:cec96dd0-e53e-4f26-b392-166f8c160ce4
Comments            : <p class="description">'What Diantha Did' was serialised in 'The Forerunner' from November 1909 to October 1910, and published separately in 1910. The main themes are 'The servant question' and the grief caused by having to do work in which one is not interested; set against a background of future female in-laws who would be ashamed to earn their own living, and a fiance who believes that 'No man - that is a man - would marry a woman and let her run a business.'</p>

$ cat ~/mrlibrary/AlexBell/255021/metadata.opf        
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuid_id" version="2.0">
    <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
        <meta name="calibre:user_metadata:#uploader" content="{&quot;kind&quot;: &quot;field&quot;, &quot;#value#&quot;: &quot;alex&quot;, &quot;column&quot;: &quot;value&quot;, &quot;colnum&quot;: 1, &quot;is_multiple&quot;: null, &quot;is_multiple2&quot;: {}, &quot;search_terms&quot;: [&quot;#uploader&quot;], &quot;is_csp&quot;: false, &quot;is_category&quot;: true, &quot;table&quot;: &quot;custom_column_1&quot;, &quot;is_custom&quot;: true, &quot;is_editable&quot;: true, &quot;rec_index&quot;: 22, &quot;link_column&quot;: &quot;value&quot;, &quot;label&quot;: &quot;uploader&quot;, &quot;#extra#&quot;: null, &quot;datatype&quot;: &quot;text&quot;, &quot;name&quot;: &quot;Uploader&quot;, &quot;category_sort&quot;: &quot;value&quot;, &quot;display&quot;: {&quot;use_decorations&quot;: 0}}"/>
    </metadata>
</package>

$ calibredb set_metadata 8 ~/mrlibrary/AlexBell/255021/metadata.opf     

Title               : Unknown
Title sort          : Unknown
Author(s)           : Unknown
Publisher           : Bellware
Tags                : romance, humanism, servant question
Languages           : eng
Timestamp           : 2015-01-30T12:18:08+00:00
Published           : 2015-01-24T13:00:00+00:00
Identifiers         : mobi-asin:cec96dd0-e53e-4f26-b392-166f8c160ce4
Comments            : <p class="description">'What Diantha Did' was serialised in 'The Forerunner' from November 1909 to October 1910, and published separately in 1910. The main themes are 'The servant question' and the grief caused by having to do work in which one is not interested; set against a background of future female in-laws who would be ashamed to earn their own living, and a fiance who believes that 'No man - that is a man - would marry a woman and let her run a business.'</p>
Uploader            : alex
Backing up metadata
Notifying calibre of the change
The Uploader field was set correctly, but notice how Title, Title sort and Author are erased?
I have to admit I didn't test this, I just knew that calibre looked for the OPF when the books is added. But, I was assuming the OPF would contain all the metadata for the book.
[/QUOTE]
@davidfor, I love the idea of a metadata source plugin that could translate the attachment id to a relevant URL! Would that be very difficult to write?[/QUOTE]

The identifier part is easy. Just look at any of the metadata source plugins and implement the get_book_url method. If you want to add the search and metadata download parts, it depends on how the site the metadata comes from is coded.
davidfor is offline   Reply With Quote