mirror of
https://github.com/ciromattia/kcc
synced 2026-06-06 14:43:28 +00:00
Add ComicInfo bookmarks -> EPUB chapter support
Bookmarks from ComicRack's ComicInfo.xml are now converted to EPUB chapters. `Bookmark` is an attribute to the `Page` element in ComicInfo.xml. * Works with flat directory structure (no sub-folders support)
This commit is contained in:
committed by
Paweł Jastrzębski
parent
57b571b6c2
commit
ecbf60fb28
+7
-1
@@ -38,7 +38,8 @@ class MetadataParser:
|
||||
'Pencillers': [],
|
||||
'Inkers': [],
|
||||
'Colorists': [],
|
||||
'MUid': ''}
|
||||
'MUid': '',
|
||||
'Bookmarks': []}
|
||||
self.rawdata = None
|
||||
self.compressor = None
|
||||
if self.source.endswith('.xml'):
|
||||
@@ -100,6 +101,11 @@ class MetadataParser:
|
||||
.search(self.rawdata.getElementsByTagName('ScanInformation')[0].firstChild.nodeValue)
|
||||
if coverId:
|
||||
self.data['MUid'] = coverId.group(2)
|
||||
if len(self.rawdata.getElementsByTagName('Page')) != 0:
|
||||
for page in self.rawdata.getElementsByTagName('Page'):
|
||||
if 'Bookmark' in page.attributes and 'Image' in page.attributes:
|
||||
self.data['Bookmarks'].append((int(page.attributes['Image'].value),
|
||||
page.attributes['Bookmark'].value))
|
||||
|
||||
def saveXML(self):
|
||||
if self.rawdata:
|
||||
|
||||
Reference in New Issue
Block a user