mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When finding the next series index and the last series index is a fractional number, use the next larget integer, instead of just adding 1
This commit is contained in:
parent
28473afea5
commit
b03e1c3a6e
@ -11,7 +11,7 @@ import os, sys, shutil, cStringIO, glob, time, functools, traceback, re, \
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import threading, random
|
import threading, random
|
||||||
from itertools import repeat
|
from itertools import repeat
|
||||||
from math import ceil
|
from math import ceil, floor
|
||||||
|
|
||||||
from calibre import prints, force_unicode
|
from calibre import prints, force_unicode
|
||||||
from calibre.ebooks.metadata import (title_sort, author_to_author_sort,
|
from calibre.ebooks.metadata import (title_sort, author_to_author_sort,
|
||||||
@ -2089,7 +2089,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
return 1.0
|
return 1.0
|
||||||
series_indices = [x[0] for x in series_indices]
|
series_indices = [x[0] for x in series_indices]
|
||||||
if tweaks['series_index_auto_increment'] == 'next':
|
if tweaks['series_index_auto_increment'] == 'next':
|
||||||
return series_indices[-1] + 1
|
return floor(series_indices[-1]) + 1
|
||||||
if tweaks['series_index_auto_increment'] == 'first_free':
|
if tweaks['series_index_auto_increment'] == 'first_free':
|
||||||
for i in range(1, 10000):
|
for i in range(1, 10000):
|
||||||
if i not in series_indices:
|
if i not in series_indices:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user