Tag Browser: When dragging and dropping a book onto a series increment the series number. Fixes #1661588 [series number does not increment when drag and drop onto a series](https://bugs.launchpad.net/calibre/+bug/1661588)

This commit is contained in:
Kovid Goyal 2017-02-03 19:57:25 +05:30
parent 6a82169373
commit 5bd92e178c

View File

@ -930,8 +930,12 @@ class TagsModel(QAbstractItemModel): # {{{
set_authors=True
elif fm['datatype'] == 'rating':
mi.set(key, len(val) * 2)
elif fm['is_custom'] and fm['datatype'] == 'series':
mi.set(key, val, extra=1.0)
elif fm['datatype'] == 'series':
series_index = self.db.new_api.get_next_series_num_for(val, field=key)
if fm['is_custom']:
mi.set(key, val, extra=series_index)
else:
mi.series, mi.series_index = val, series_index
elif is_multiple:
new_val = mi.get(key, [])
if val in new_val: