mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Series ordering fix and bug #5744
This commit is contained in:
parent
5f3e1f5128
commit
cb332cdfb5
@ -185,11 +185,17 @@ class TagsView(QTreeView): # {{{
|
|||||||
if self.model():
|
if self.model():
|
||||||
self.model().clear_state()
|
self.model().clear_state()
|
||||||
|
|
||||||
|
def is_visible(self, idx):
|
||||||
|
item = idx.internalPointer()
|
||||||
|
if item.type == TagTreeItem.TAG:
|
||||||
|
idx = idx.parent()
|
||||||
|
return self.isExpanded(idx)
|
||||||
|
|
||||||
def recount(self, *args):
|
def recount(self, *args):
|
||||||
ci = self.currentIndex()
|
ci = self.currentIndex()
|
||||||
if not ci.isValid():
|
if not ci.isValid():
|
||||||
ci = self.indexAt(QPoint(10, 10))
|
ci = self.indexAt(QPoint(10, 10))
|
||||||
path = self.model().path_for_index(ci)
|
path = self.model().path_for_index(ci) if self.is_visible(ci) else None
|
||||||
try:
|
try:
|
||||||
self.model().refresh()
|
self.model().refresh()
|
||||||
except: #Database connection could be closed if an integrity check is happening
|
except: #Database connection could be closed if an integrity check is happening
|
||||||
|
@ -1049,8 +1049,10 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
# new series index to each of the books.
|
# new series index to each of the books.
|
||||||
|
|
||||||
# Get the list of books where we must update the series index
|
# Get the list of books where we must update the series index
|
||||||
books = self.conn.get('''SELECT book from books_series_link
|
books = self.conn.get('''SELECT books.id
|
||||||
WHERE series=?''', (old_id,))
|
FROM books, books_series_link as lt
|
||||||
|
WHERE books.id = lt.book AND lt.series=?
|
||||||
|
ORDER BY books.series_index''', (old_id,))
|
||||||
# Get the next series index
|
# Get the next series index
|
||||||
index = self.get_next_series_num_for(new_name)
|
index = self.get_next_series_num_for(new_name)
|
||||||
# Now update the link table
|
# Now update the link table
|
||||||
|
Loading…
x
Reference in New Issue
Block a user