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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-27-2014, 02:14 AM   #1
KoopaOne
Austrian Bookworm
KoopaOne began at the beginning.
 
KoopaOne's Avatar
 
Posts: 126
Karma: 14
Join Date: Oct 2007
Location: Austria
Device: Pocketbook Touch Lux 2
Pocketbook 626: Metadata Info not correctly displayed

Hi,

there is a know problem, that the Pocketbook Devices (at least the Lux2) doesn't correctly show the correct book info, if the metadata isn't organized in a special way. It seems, that the Pocketbooks stop to read data from the series_info onwards.

Metadata that works:
Code:
<dc:subject>Versuch</dc:subject>
    <dc:language>de</dc:language>
    <dc:identifier opf:scheme="calibre">0587642b-2b94-4384-a79a-49541fa8a24d</dc:identifier>
    <meta content="0.7.2" name="Sigil version"/>
    <meta content="Metadaten-Test" name="calibre:title_sort"/>
    <meta content="{&quot;Klecks&quot;: &quot;&quot;}" name="calibre:author_link_map"/>
    <meta content="2014-10-26T10:28:34.540000+00:00" name="calibre:timestamp"/>
    <meta name="calibre:series" content="eBook Testdateien"/>
    <meta name="calibre:series_index" content="1.0"/>
    <meta name="cover" content="cover"/>
Metadat that does't work:
Code:
<dc:subject>Versuch</dc:subject>
    <dc:language>de</dc:language>
    <dc:identifier opf:scheme="calibre">928e1c34-32f7-497d-9437-b91765614d10</dc:identifier>
    <meta content="0.7.2" name="Sigil version"/>
    <meta name="calibre:series" content="eBook Testdateien"/>
    <meta name="calibre:series_index" content="1.0"/>
    <meta content="Metadaten-Test" name="calibre:title_sort"/>
    <meta content="{&quot;Klecks&quot;: &quot;&quot;}" name="calibre:author_link_map"/>
    <meta content="2014-10-26T10:28:34.540000+00:00" name="calibre:timestamp"/>
    <meta name="cover" content="cover"/>
As you can see, the only difference is the position of the calibre:series related information.

I already tried to edit the file \calibre-master\src\calibre\ebooks\metadata\opf2.py, but my python and knowledge of the calibre source isn't good enough to recognize where i have to change the source to get calibre to write the medadata in a format the Lux2 can recognize.

I already tried to change the smart_update, but that didn't work ...
Code:
    def smart_update(self, mi, replace_metadata=False, apply_null=False):
        for attr in ('title', 'authors', 'author_sort', 'title_sort', 'publisher', 'rating', 'isbn', 'tags', 'category', 'comments', 'book_producer', 'pubdate', 'user_categories', 'author_link_map', 'series', 'series_index'):
            val = getattr(mi, attr, None)
            is_null = val is None or val in ((), [], (None, None), {})
            if is_null:
                if apply_null and attr in {'series', 'tags', 'isbn', 'comments', 'publisher'}:
                    setattr(self, attr, ([] if attr == 'tags' else None))
            else:
                setattr(self, attr, val)
Can someone help?
KoopaOne is offline   Reply With Quote
Old 10-27-2014, 03:07 AM   #2
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: 27,184
Karma: 5612109
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You want to modify the render() method. You'd have to re-arrange the child elements of the metadata element before rendering. Something like this:

for child in tuple(self.metadata):
if child is to be moved to end:
self.metadata.append(child)
kovidgoyal is offline   Reply With Quote
Old 10-27-2014, 03:38 AM   #3
KoopaOne
Austrian Bookworm
KoopaOne began at the beginning.
 
KoopaOne's Avatar
 
Posts: 126
Karma: 14
Join Date: Oct 2007
Location: Austria
Device: Pocketbook Touch Lux 2
Currently the method looks like this:
Code:
   def render(self, encoding='utf-8'):
        for meta in self.raster_cover_path(self.metadata):
            # Ensure that the name attribute occurs before the content
            # attribute. Needed for Nooks.
            a = meta.attrib
            c = a.get('content', None)
            if c is not None:
                del a['content']
                a['content'] = c
The above code switches just "name" and "content" within one metadata line, right? So how would i delete a metadata line and move it to the end?

I simply want these two lines to be at the end:
Code:
  <meta name="calibre:series" content="eBook Testdateien"/>
  <meta name="calibre:series_index" content="1.0"/>
how would that code look like? I tried this, but nothing happens ...
Code:
   def render(self, encoding='utf-8'):
        for meta in self.raster_cover_path(self.metadata):
            # Ensure that the name attribute occurs before the content
            # attribute. Needed for Nooks.
            a = meta.attrib
            c = a.get('content', None)
            if c is not None:
                del a['content']
                a['content'] = c
			#Ensure that the Series Stuff is at the end of the metadata
			# Needed for Pocketbooks
			d = a.get('name', None)
			if d == 'calibre:series' or d == 'calibre:series_index':
				self.metadata.append(meta)

Last edited by KoopaOne; 10-27-2014 at 04:25 AM.
KoopaOne is offline   Reply With Quote
Old 10-27-2014, 05:15 AM   #4
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: 27,184
Karma: 5612109
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
for child in tuple(self.metadata):
  if 'calibre:' in child.get('name', ''):
     self.metadata.append(child)
kovidgoyal is offline   Reply With Quote
Old 10-27-2014, 06:01 AM   #5
KoopaOne
Austrian Bookworm
KoopaOne began at the beginning.
 
KoopaOne's Avatar
 
Posts: 126
Karma: 14
Join Date: Oct 2007
Location: Austria
Device: Pocketbook Touch Lux 2
Quote:
Originally Posted by kovidgoyal View Post
Code:
for child in tuple(self.metadata):
  if 'calibre:' in child.get('name', ''):
     self.metadata.append(child)
Works like a charm, thank you very much!
KoopaOne is offline   Reply With Quote
Old 02-03-2015, 09:18 AM   #6
h0nza
Junior Member
h0nza began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2015
Device: Pocketbook 626
Quote:
Originally Posted by KoopaOne View Post
Works like a charm, thank you very much!
Hi. Is there any way how to make this modification in windows distribution? Metadata on Pocketbook 626 makes me crazy !
please. Thx a lot.
h0nza is offline   Reply With Quote
Old 02-03-2015, 10:54 AM   #7
eschwartz
Suspended
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
Posts: 12,029
Karma: 26723054
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
See: http://manual.calibre-ebook.com/develop.html

And make the above mentioned modifications in the source tree.
eschwartz is offline   Reply With Quote
Old 02-08-2015, 02:38 PM   #8
h0nza
Junior Member
h0nza began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2015
Device: Pocketbook 626
It works!!! Thank you.
h0nza is offline   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
pocketbook touch lux 2 - 626 reset? sassi PocketBook 6 06-24-2014 04:02 AM
Questions on the Pocketbook 626 / Touch Lux 2 mat813 PocketBook 3 03-28-2014 01:00 PM
Cover Only Displayed Correctly on MOBI but not EPUB dwal Conversion 3 03-01-2013 01:26 PM
arabic not displayed correctly after converting with calibre mhmohamadi Apple Devices 0 05-23-2010 02:26 PM
PRS-600 Are Romanian diacritics displayed correctly? Laurentiu Sony Reader 3 11-25-2009 03:36 PM


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


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