mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Also auto increment series index when editing in table view
This commit is contained in:
parent
418e392878
commit
f1dfa30e30
@ -29,7 +29,7 @@ class LinuxFreeze(Command):
|
|||||||
|
|
||||||
QTDIR = '/usr/lib/qt4'
|
QTDIR = '/usr/lib/qt4'
|
||||||
QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml',
|
QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml',
|
||||||
'QtWebKit', 'QtDBus')
|
'QtWebKit', 'QtDBus', 'QtXmlPatterns')
|
||||||
|
|
||||||
binary_excludes = ['libGLcore*', 'libGL*', 'libnvidia*']
|
binary_excludes = ['libGLcore*', 'libGL*', 'libnvidia*']
|
||||||
|
|
||||||
|
@ -636,12 +636,16 @@ class BooksModel(QAbstractTableModel):
|
|||||||
val *= 2
|
val *= 2
|
||||||
self.db.set_rating(id, val)
|
self.db.set_rating(id, val)
|
||||||
elif column == 'series':
|
elif column == 'series':
|
||||||
|
val = val.strip()
|
||||||
pat = re.compile(r'\[([.0-9]+)\]')
|
pat = re.compile(r'\[([.0-9]+)\]')
|
||||||
match = pat.search(val)
|
match = pat.search(val)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
self.db.set_series_index(id, float(match.group(1)))
|
self.db.set_series_index(id, float(match.group(1)))
|
||||||
val = pat.sub('', val)
|
val = pat.sub('', val)
|
||||||
val = val.strip()
|
elif val:
|
||||||
|
ni = self.db.get_next_series_num_for(val)
|
||||||
|
if ni != 1:
|
||||||
|
self.db.set_series_index(id, ni)
|
||||||
if val:
|
if val:
|
||||||
self.db.set_series(id, val)
|
self.db.set_series(id, val)
|
||||||
elif column == 'timestamp':
|
elif column == 'timestamp':
|
||||||
|
@ -72,6 +72,8 @@ class RecipeInput(InputFormatPlugin):
|
|||||||
if builtin:
|
if builtin:
|
||||||
raw = get_builtin_recipe_by_title(title, log=log,
|
raw = get_builtin_recipe_by_title(title, log=log,
|
||||||
download_recipe=False)
|
download_recipe=False)
|
||||||
|
if raw is None:
|
||||||
|
raise ValueError('Failed to find builtin recipe: '+title)
|
||||||
recipe = compile_recipe(raw)
|
recipe = compile_recipe(raw)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user