mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When adding books to the GUI, do not randomly generate a UUID as application_id as this breaks direct adding to device
This commit is contained in:
parent
769e304195
commit
10b7714cc4
@ -35,6 +35,8 @@ def read_metadata_(task, tdir, notification=lambda x,y:x):
|
|||||||
if mi.cover_data:
|
if mi.cover_data:
|
||||||
cdata = mi.cover_data[-1]
|
cdata = mi.cover_data[-1]
|
||||||
mi.cover_data = None
|
mi.cover_data = None
|
||||||
|
if not mi.application_id:
|
||||||
|
mi.application_id = '__calibre_dummy__'
|
||||||
with open(os.path.join(tdir, '%s.opf'%id), 'wb') as f:
|
with open(os.path.join(tdir, '%s.opf'%id), 'wb') as f:
|
||||||
f.write(metadata_to_opf(mi))
|
f.write(metadata_to_opf(mi))
|
||||||
if cdata:
|
if cdata:
|
||||||
|
@ -181,6 +181,8 @@ class DBAdder(Thread):
|
|||||||
mi.title = os.path.splitext(name)[0]
|
mi.title = os.path.splitext(name)[0]
|
||||||
mi.title = mi.title if isinstance(mi.title, unicode) else \
|
mi.title = mi.title if isinstance(mi.title, unicode) else \
|
||||||
mi.title.decode(preferred_encoding, 'replace')
|
mi.title.decode(preferred_encoding, 'replace')
|
||||||
|
if mi.application_id == '__calibre_dummy__':
|
||||||
|
mi.application_id = None
|
||||||
if self.db is not None:
|
if self.db is not None:
|
||||||
if cover:
|
if cover:
|
||||||
cover = open(cover, 'rb').read()
|
cover = open(cover, 'rb').read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user