View Single Post
Old 12-13-2020, 11:26 AM   #7
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
You misunderstand.

It is trivial to refresh the Library View from the Cache, but only if the Cache itself has just been refreshed from metadata.db.

I was reloading the book ids from the physical SQLite database into the Cache by using the "refreshdb:" IPC message that no longer exists in Calibre 5.7.

Hard-drive to Cache, not Cache to GUI Library View.


Added: History: I began to use IPC to refresh the Cache after you deprecated using "calibredb --add-books" while the current Calibre Library GUI was running. It was so easy with "calibredb --add-books".





I will try this next:

Code:
class ResultCache(SearchQueryParser):

    def refresh_ids(self, db, ids):
        '''
        Refresh the data in the cache for books identified by ids.
        Returns a list of affected rows or None if the rows are filtered.
        '''
        for id in ids:
            try:
                self._data[id] = CacheRow(db, self.composites, self.datetimes,
                        db.conn.get('SELECT * from meta2 WHERE id=?', (id,))[0],
                        self.series_col, self.series_sort_col)
                self._data[id].append(db.book_on_device_string(id))
                self._data[id].append(self.marked_ids_dict.get(id, None))
                self._data[id].append(None)
                self._uuid_map[self._data[id][self._uuid_column_index]] = id
            except IndexError:
                return None
        try:
            return list(map(self.row, ids))
        except ValueError:
            pass
        return None

Last edited by DaltonST; 12-13-2020 at 11:39 AM. Reason: History: calibredb --add-books
DaltonST is offline   Reply With Quote