mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
SONY driver: Fix bug when adding records to empty cacheExt.xml
This commit is contained in:
parent
330a7c989b
commit
7988560d75
@ -573,7 +573,10 @@ class XMLCache(object):
|
|||||||
ans = root.makeelement('{%s}text'%namespace, attrib=attrib,
|
ans = root.makeelement('{%s}text'%namespace, attrib=attrib,
|
||||||
nsmap=root.nsmap)
|
nsmap=root.nsmap)
|
||||||
ans.tail = '\n'
|
ans.tail = '\n'
|
||||||
root[-1].tail = '\n' + '\t'
|
if len(root) > 0:
|
||||||
|
root[-1].tail = '\n\t'
|
||||||
|
else:
|
||||||
|
root.text = '\n\t'
|
||||||
root.append(ans)
|
root.append(ans)
|
||||||
if thumbnail and thumbnail[-1]:
|
if thumbnail and thumbnail[-1]:
|
||||||
ans.text = '\n' + '\t\t'
|
ans.text = '\n' + '\t\t'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user