When reviewing metadata if the newly downloaded metadata has no language but there is an existing language, ensure it is preserved. Fixes #1959981 [book metadata download fails language attribute](https://bugs.launchpad.net/calibre/+bug/1959981)

This commit is contained in:
Kovid Goyal 2022-02-04 08:19:18 +05:30
parent 8ceb229914
commit b36c5e7624
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -547,6 +547,13 @@ class CompareSingle(QWidget):
if val != self.initial_vals[field]:
widgets.new.to_mi(self.current_mi)
changed = True
if changed and not self.current_mi.languages:
# this is needed because blank language setting
# causes current UI language to be set
widgets = self.widgets['languages']
neww, oldw = widgets[:2]
if oldw.current_val:
self.current_mi.languages = oldw.current_val
return changed