Also allow restoring notes to work with notes backed up before the restore fix

This commit is contained in:
Kovid Goyal 2023-11-18 07:47:33 +05:30
parent d94eff1f48
commit 5785023722
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 2 deletions

View File

@ -498,8 +498,13 @@ class Notes:
errors.append(_('Failed to read from document for {path} with error: {error}').format(path=f'{field}:{old_item_id}', error=e))
report_progress('', i)
continue
parts = raw.split(SEP, 3)
try:
doc, searchable_text, res, old_item_val = (str(x, 'utf-8') for x in raw.split(SEP, 3))
if len(parts) == 4:
doc, searchable_text, res, old_item_val = (str(x, 'utf-8') for x in parts)
else:
doc, searchable_text, res = (str(x, 'utf-8') for x in parts)
old_item_val = searchable_text.split('\n')[0]
except Exception as err:
errors.append(_('Failed to parse document for: {0} with error: {1}').format(old_item_id, err))
report_progress('', i)

View File

@ -20,7 +20,7 @@ class DBRestore(QDialog):
self.l = QVBoxLayout()
self.setLayout(self.l)
self.l1 = QLabel('<b>'+_('Restoring database from backups, do not'
' interrupt, this will happen in three stages')+'...')
' interrupt, this will happen in multiple stages')+'...')
self.setWindowTitle(_('Restoring database'))
self.l.addWidget(self.l1)
self.pb = QProgressBar(self)