Bulk metadata download: Fix series number not being changes if the series is the same as the existing series

This commit is contained in:
Kovid Goyal 2021-01-19 18:20:49 +05:30
parent db7d56a153
commit 3be5856df5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -40,10 +40,13 @@ def merge_result(oldmi, newmi, ensure_fields=None):
for f in fields:
# Optimize so that set_metadata does not have to do extra work later
if not f.startswith('identifier:'):
if not f.startswith('identifier:') and f not in ('series', 'series_index'):
if (not newmi.is_null(f) and is_equal(getattr(newmi, f),
getattr(oldmi, f))):
setattr(newmi, f, getattr(dummy, f))
if (newmi.series, newmi.series_index) == (oldmi.series, oldmi.series_index):
newmi.series = None
newmi.series_index = 1
return newmi