Skip to content

Commit

Permalink
When reviewing metadata if the newly downloaded metadata has no langu…
Browse files Browse the repository at this point in the history
…age 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)
  • Loading branch information
kovidgoyal committed Feb 4, 2022
1 parent 8ceb229 commit b36c5e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/calibre/gui2/metadata/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,13 @@ def apply_changes(self):
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


Expand Down

0 comments on commit b36c5e7

Please sign in to comment.