mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
add optional parameter asin to MetadataUpdater.update()
This commit is contained in:
parent
2ae7b84161
commit
c20f4a43f1
@ -325,7 +325,7 @@ class MetadataUpdater(object):
|
|||||||
stop, = unpack('>I', self.data[offoff + 8:offoff + 12])
|
stop, = unpack('>I', self.data[offoff + 8:offoff + 12])
|
||||||
return StreamSlicer(self.stream, start, stop)
|
return StreamSlicer(self.stream, start, stop)
|
||||||
|
|
||||||
def update(self, mi):
|
def update(self, mi, asin=None):
|
||||||
mi.title = normalize(mi.title)
|
mi.title = normalize(mi.title)
|
||||||
|
|
||||||
def update_exth_record(rec):
|
def update_exth_record(rec):
|
||||||
@ -399,6 +399,11 @@ class MetadataUpdater(object):
|
|||||||
not added_501 and not share_not_sync):
|
not added_501 and not share_not_sync):
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
update_exth_record((113, unicode_type(uuid4()).encode(self.codec)))
|
update_exth_record((113, unicode_type(uuid4()).encode(self.codec)))
|
||||||
|
|
||||||
|
if asin is not None:
|
||||||
|
update_exth_record((113, asin.encode(self.codec)))
|
||||||
|
update_exth_record((504, asin.encode(self.codec)))
|
||||||
|
|
||||||
# Add a 112 record with actual UUID
|
# Add a 112 record with actual UUID
|
||||||
if getattr(mi, 'uuid', None):
|
if getattr(mi, 'uuid', None):
|
||||||
update_exth_record((112,
|
update_exth_record((112,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user