mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 10:46:40 +00:00
fix various metadata editor bugs (#1099)
This commit is contained in:
@@ -604,8 +604,6 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
dname = QFileDialog.getExistingDirectory(MW, 'Select directory', self.lastPath)
|
dname = QFileDialog.getExistingDirectory(MW, 'Select directory', self.lastPath)
|
||||||
if dname != '':
|
if dname != '':
|
||||||
sname = os.path.join(dname, 'ComicInfo.xml')
|
sname = os.path.join(dname, 'ComicInfo.xml')
|
||||||
if sys.platform.startswith('win'):
|
|
||||||
sname = sname.replace('/', '\\')
|
|
||||||
self.lastPath = os.path.abspath(sname)
|
self.lastPath = os.path.abspath(sname)
|
||||||
else:
|
else:
|
||||||
if self.sevenzip:
|
if self.sevenzip:
|
||||||
@@ -617,10 +615,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
self.addMessage('<a href="https://github.com/ciromattia/kcc#7-zip">Install 7z (link)</a>'
|
self.addMessage('<a href="https://github.com/ciromattia/kcc#7-zip">Install 7z (link)</a>'
|
||||||
' to enable metadata editing.', 'warning')
|
' to enable metadata editing.', 'warning')
|
||||||
if fname[0] != '':
|
if fname[0] != '':
|
||||||
if sys.platform.startswith('win'):
|
sname = fname[0]
|
||||||
sname = fname[0].replace('/', '\\')
|
|
||||||
else:
|
|
||||||
sname = fname[0]
|
|
||||||
self.lastPath = os.path.abspath(os.path.join(sname, os.pardir))
|
self.lastPath = os.path.abspath(os.path.join(sname, os.pardir))
|
||||||
if sname != '':
|
if sname != '':
|
||||||
try:
|
try:
|
||||||
@@ -1354,10 +1349,11 @@ class KCCGUI_MetaEditor(KCC_ui_editor.Ui_editorDialog):
|
|||||||
field.setText(', '.join(self.parser.data[field.objectName().capitalize()[:-4] + 's']))
|
field.setText(', '.join(self.parser.data[field.objectName().capitalize()[:-4] + 's']))
|
||||||
for field in (self.seriesLine, self.titleLine):
|
for field in (self.seriesLine, self.titleLine):
|
||||||
if field.text() == '':
|
if field.text() == '':
|
||||||
|
path = Path(file)
|
||||||
if file.endswith('.xml'):
|
if file.endswith('.xml'):
|
||||||
field.setText(file.split('\\')[-2])
|
field.setText(path.parent.name)
|
||||||
else:
|
else:
|
||||||
field.setText(file.split('\\')[-1].split('/')[-1].split('.')[0])
|
field.setText(path.stem)
|
||||||
|
|
||||||
def saveData(self):
|
def saveData(self):
|
||||||
for field in (self.volumeLine, self.numberLine):
|
for field in (self.volumeLine, self.numberLine):
|
||||||
|
|||||||
Reference in New Issue
Block a user