mirror of
https://github.com/ciromattia/kcc
synced 2026-10-19 16:02:33 +00:00
Fix CBR read-only check in bulk metadata editor
* Check all files for CBR format during load instead of during save * Unify the CBR check for single and bulk mode
This commit is contained in:
@@ -1440,6 +1440,15 @@ class KCCGUI_MetaEditor(KCC_ui_editor.Ui_editorDialog):
|
|||||||
# Sort files by name for consistent volume assignment
|
# Sort files by name for consistent volume assignment
|
||||||
self.files.sort()
|
self.files.sort()
|
||||||
|
|
||||||
|
# Unified CBR check for all files (both single and bulk mode)
|
||||||
|
for file in self.files:
|
||||||
|
parser = metadata.MetadataParser(file)
|
||||||
|
if parser.format in ['RAR', 'RAR5']:
|
||||||
|
self.editorWidget.setEnabled(False)
|
||||||
|
self.okButton.setEnabled(False)
|
||||||
|
self.statusLabel.setText('CBR files in selection are read-only.')
|
||||||
|
return
|
||||||
|
|
||||||
if self.bulkMode:
|
if self.bulkMode:
|
||||||
firstFile = self.files[0]
|
firstFile = self.files[0]
|
||||||
self.parser = metadata.MetadataParser(firstFile)
|
self.parser = metadata.MetadataParser(firstFile)
|
||||||
@@ -1477,14 +1486,9 @@ class KCCGUI_MetaEditor(KCC_ui_editor.Ui_editorDialog):
|
|||||||
field.setEnabled(True)
|
field.setEnabled(True)
|
||||||
field.setPlaceholderText('')
|
field.setPlaceholderText('')
|
||||||
|
|
||||||
if self.parser.format in ['RAR', 'RAR5']:
|
self.editorWidget.setEnabled(True)
|
||||||
self.editorWidget.setEnabled(False)
|
self.okButton.setEnabled(True)
|
||||||
self.okButton.setEnabled(False)
|
self.statusLabel.setText('Separate authors with a comma.')
|
||||||
self.statusLabel.setText('CBR metadata are read-only.')
|
|
||||||
else:
|
|
||||||
self.editorWidget.setEnabled(True)
|
|
||||||
self.okButton.setEnabled(True)
|
|
||||||
self.statusLabel.setText('Separate authors with a comma.')
|
|
||||||
|
|
||||||
for field in (self.seriesLine, self.volumeLine, self.numberLine, self.titleLine):
|
for field in (self.seriesLine, self.volumeLine, self.numberLine, self.titleLine):
|
||||||
field.setText(self.parser.data[field.objectName().capitalize()[:-4]])
|
field.setText(self.parser.data[field.objectName().capitalize()[:-4]])
|
||||||
|
|||||||
Reference in New Issue
Block a user