From b0e38a700a8a1999ac560711cbc808555deb0890 Mon Sep 17 00:00:00 2001 From: Jaroslaw Janas Date: Mon, 22 May 2023 21:46:51 +0200 Subject: [PATCH 1/6] Bump conda python to 3.11 (#524) --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 655ea38..a87d9d0 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python=3.8 + - python=3.11 - Pillow>=5.2.0 - psutil>=5.0.0 - python-slugify>=1.2.1 From 935727c1dbd1eb60042529230e8df82960de02da Mon Sep 17 00:00:00 2001 From: Vinh Quang Tran Date: Sat, 10 Jun 2023 16:13:01 +0700 Subject: [PATCH 2/6] Override book's title if `Title` is set in XML (#532) * Allow overriding title if it is set in XML --- kindlecomicconverter/comic2ebook.py | 4 +++- kindlecomicconverter/metadata.py | 11 ++++++++--- requirements.txt | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 398bf21..7ff7d97 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -695,7 +695,9 @@ def getComicInfo(path, originalpath): os.remove(xmlPath) return options.authors = [] - if defaultTitle: + if xml.data['Title']: + options.title = hescape(xml.data['Title']) + elif defaultTitle: if xml.data['Series']: options.title = hescape(xml.data['Series']) if xml.data['Volume']: diff --git a/kindlecomicconverter/metadata.py b/kindlecomicconverter/metadata.py index b431be1..9d60616 100644 --- a/kindlecomicconverter/metadata.py +++ b/kindlecomicconverter/metadata.py @@ -34,7 +34,8 @@ class MetadataParser: 'Inkers': [], 'Colorists': [], 'Summary': '', - 'Bookmarks': []} + 'Bookmarks': [], + 'Title': ''} self.rawdata = None self.format = None if self.source.endswith('.xml') and os.path.exists(self.source): @@ -58,6 +59,8 @@ class MetadataParser: self.data['Number'] = self.rawdata.getElementsByTagName('Number')[0].firstChild.nodeValue if len(self.rawdata.getElementsByTagName('Summary')) != 0: self.data['Summary'] = self.rawdata.getElementsByTagName('Summary')[0].firstChild.nodeValue + if len(self.rawdata.getElementsByTagName('Title')) != 0: + self.data['Title'] = self.rawdata.getElementsByTagName('Title')[0].firstChild.nodeValue for field in ['Writer', 'Penciller', 'Inker', 'Colorist']: if len(self.rawdata.getElementsByTagName(field)) != 0: for person in self.rawdata.getElementsByTagName(field)[0].firstChild.nodeValue.split(', '): @@ -76,7 +79,8 @@ class MetadataParser: for row in (['Series', self.data['Series']], ['Volume', self.data['Volume']], ['Number', self.data['Number']], ['Writer', ', '.join(self.data['Writers'])], ['Penciller', ', '.join(self.data['Pencillers'])], ['Inker', ', '.join(self.data['Inkers'])], - ['Colorist', ', '.join(self.data['Colorists'])], ['Summary', self.data['Summary']]): + ['Colorist', ', '.join(self.data['Colorists'])], ['Summary', self.data['Summary']], + ['Title', self.data['Title']]): if self.rawdata.getElementsByTagName(row[0]): node = self.rawdata.getElementsByTagName(row[0])[0] if row[1]: @@ -97,7 +101,8 @@ class MetadataParser: for row in (['Series', self.data['Series']], ['Volume', self.data['Volume']], ['Number', self.data['Number']], ['Writer', ', '.join(self.data['Writers'])], ['Penciller', ', '.join(self.data['Pencillers'])], ['Inker', ', '.join(self.data['Inkers'])], - ['Colorist', ', '.join(self.data['Colorists'])], ['Summary', self.data['Summary']]): + ['Colorist', ', '.join(self.data['Colorists'])], ['Summary', self.data['Summary']], + ['Title', self.data['Title']]): if row[1]: main = doc.createElement(row[0]) root.appendChild(main) diff --git a/requirements.txt b/requirements.txt index 156b842..7e852a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ python-slugify>=1.2.1 raven>=6.0.0 # PyQt5-tools mozjpeg-lossless-optimization>=1.1.2 -distro \ No newline at end of file +distro From 4923dac8f0fcc6d8891a6cb03da812d3454cc4fb Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 10 Jun 2023 04:14:41 -0700 Subject: [PATCH 3/6] explicitly name disabled archives (#531) * explicitly name disabled archives --- kindlecomicconverter/KCC_gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index b500ecc..3683f3f 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -1040,8 +1040,8 @@ class KCCGUI(KCC_ui.Ui_mainWindow): self.sevenzip = True else: self.sevenzip = False - self.addMessage('Add 7z to PATH!' - ' Processing of archives will be disabled.', 'warning') + self.addMessage('Install 7-Zip and add 7z to PATH!' + ' CBZ/CBR/ZIP/etc processing disabled.', 'warning') self.detectKindleGen(True) APP.messageFromOtherInstance.connect(self.handleMessage) From 95678adfd6943739167ba83cca70ca5f8c04a7a6 Mon Sep 17 00:00:00 2001 From: darodi <4682830+darodi@users.noreply.github.com> Date: Mon, 12 Jun 2023 18:28:21 +0000 Subject: [PATCH 4/6] change format labels in gui (#538) --- kindlecomicconverter/KCC_gui.py | 34 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 3683f3f..a2e92f8 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -113,12 +113,6 @@ class Icons: self.CBZFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/CBZ.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.EPUBFormat = QtGui.QIcon() self.EPUBFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/EPUB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.KFXFormat = QtGui.QIcon() - self.KFXFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/KFX.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.MOBIEPUBFormat = QtGui.QIcon() - self.MOBIEPUBFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/MOBI.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.EPUB200MBFormat = QtGui.QIcon() - self.EPUB200MBFormat.addPixmap(QtGui.QPixmap(":/Formats/icons/EPUB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.info = QtGui.QIcon() self.info.addPixmap(QtGui.QPixmap(":/Status/icons/info.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) @@ -224,7 +218,8 @@ class WorkerThread(QtCore.QThread): currentJobs = [] options.profile = GUI.profiles[str(GUI.deviceBox.currentText())]['Label'] - options.format = str(GUI.formatBox.currentText()).replace('/AZW3', '') + gui_current_format = GUI.formats[str(GUI.formatBox.currentText())]['format'] + options.format = gui_current_format if GUI.mangaBox.isChecked(): options.righttoleft = True if GUI.rotateBox.checkState() == 1: @@ -280,7 +275,7 @@ class WorkerThread(QtCore.QThread): return self.errors = False MW.addMessage.emit('Source: ' + job, 'info', False) - if str(GUI.formatBox.currentText()) == 'CBZ': + if gui_current_format == 'CBZ': MW.addMessage.emit('Creating CBZ files', 'info', False) GUI.progress.content = 'Creating CBZ files' else: @@ -330,11 +325,11 @@ class WorkerThread(QtCore.QThread): return if not self.errors: GUI.progress.content = '' - if str(GUI.formatBox.currentText()) == 'CBZ': + if gui_current_format == 'CBZ': MW.addMessage.emit('Creating CBZ files... Done!', 'info', True) else: MW.addMessage.emit('Creating EPUB files... Done!', 'info', True) - if str(GUI.formatBox.currentText()) == 'MOBI/AZW3' or str(GUI.formatBox.currentText()) == 'MOBI+EPUB': + if 'MOBI' in gui_current_format: MW.progressBarTick.emit('Creating MOBI files') MW.progressBarTick.emit(str(len(outputPath) * 2 + 1)) MW.progressBarTick.emit('tick') @@ -662,7 +657,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): GUI.formatBox.setCurrentIndex(profile['DefaultFormat']) if not GUI.webtoonBox.isChecked(): GUI.qualityBox.setEnabled(profile['PVOptions']) - if str(GUI.formatBox.currentText()) == 'MOBI/AZW3': + if GUI.formats[str(GUI.formatBox.currentText())]['format'] == 'MOBI': GUI.outputSplit.setEnabled(True) else: GUI.outputSplit.setEnabled(False) @@ -744,7 +739,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): self.addMessage('Target resolution is not set!', 'error') self.needClean = True return - if str(GUI.formatBox.currentText()) == 'MOBI/AZW3' and not self.kindleGen: + if 'MOBI' in GUI.formats[str(GUI.formatBox.currentText())]['format'] and not self.kindleGen: self.detectKindleGen() if not self.kindleGen: GUI.jobList.clear() @@ -918,6 +913,16 @@ class KCCGUI(KCC_ui.Ui_mainWindow): if self.windowSize == '0x0': MW.resize(500, 500) + self.formats = { # text, icon, data/option_format + "MOBI/AZW3": {'icon': 'MOBI', 'format': 'MOBI'}, + "EPUB": {'icon': 'EPUB', 'format': 'EPUB'}, + "CBZ": {'icon': 'CBZ', 'format': 'CBZ'}, + "EPUB (Calibre KFX)": {'icon': 'EPUB', 'format': 'KFX'}, + "MOBI + EPUB": {'icon': 'MOBI', 'format': 'MOBI+EPUB'}, + "EPUB (200MB limit)": {'icon': 'EPUB', 'format': 'EPUB-200MB'} + } + + self.profiles = { "Kindle Oasis 2/3": {'PVOptions': True, 'ForceExpert': False, 'DefaultFormat': 0, 'DefaultUpscale': True, 'Label': 'KO'}, @@ -1082,9 +1087,8 @@ class KCCGUI(KCC_ui.Ui_mainWindow): GUI.deviceBox.addItem(self.icons.deviceKobo, profile) else: GUI.deviceBox.addItem(self.icons.deviceKindle, profile) - for f in ['MOBI/AZW3', 'EPUB', 'CBZ', 'KFX', 'MOBI+EPUB', 'EPUB-200MB']: - format_prefix = f.replace('/AZW3', '').replace('+', '').replace('-', '') - GUI.formatBox.addItem(eval('self.icons.' + format_prefix + 'Format'), f) + for f in self.formats: + GUI.formatBox.addItem(eval('self.icons.' + self.formats[f]['icon'] + 'Format'), f) if self.lastDevice > GUI.deviceBox.count(): self.lastDevice = 0 if profilesGUI[self.lastDevice] == "Separator": From 62d1c7c488975b9eb1a93b19f86d1b0adc4dc783 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 12 Jun 2023 13:16:26 -0700 Subject: [PATCH 5/6] add 7z wiki link (#543) --- README.md | 2 -- kindlecomicconverter/KCC_gui.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index edfa464..e71c38b 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,6 @@ $ sudo apt-get install qt5dxcb-plugin - CB7, 7Z *(With `7z` executable)* - PDF *(Only extracting JPG images)* -Add 7z to PATH via `setx path "%path%;C:\Program Files\7-Zip"` - ## USAGE Should be pretty self-explanatory. All options have detailed information in tooltips. diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index a2e92f8..e239277 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -1045,7 +1045,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): self.sevenzip = True else: self.sevenzip = False - self.addMessage('Install 7-Zip and add 7z to PATH!' + self.addMessage('Install 7z and add to PATH!!' ' CBZ/CBR/ZIP/etc processing disabled.', 'warning') self.detectKindleGen(True) From e7e41715d0444078b39a54ba82c54bc42dc020ac Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Tue, 27 Jun 2023 09:59:33 -0700 Subject: [PATCH 6/6] rename binary releases to downloads (#545) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e71c38b..a74562f 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ If you find **KCC** valuable you can consider donating to the authors: ## INSTALLATION -### BINARY RELEASES +### DOWNLOADS You can find the latest binary at the following link: - **https://github.com/ciromattia/kcc/releases**