View Single Post
Old 08-24-2022, 06:45 AM   #12
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,529
Karma: 8075938
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
Wheeeeeeeeeeee !!

That works lol!! NOW THE EMBLEM SHOWS UP INSTANTLY! (for any filetype)


I just added that line here:
Code:
   for book_id in book_ids:
                now = datetime.datetime.now()
                viewdate = format_date(now, dateformat, assume_utc=False, as_utc=False)
                db.set_custom(book_id, viewdate, label=label, commit=True)
                self.gui.library_view.model().refresh_ids(book_ids)
FWIW: the refresh_ids should be after the loop, not in the loop. As it is the code is refreshing all books for every book, which could create a performance problem. I suggest
Code:
    for book_id in book_ids:
        now = datetime.datetime.now()
        viewdate = format_date(now, dateformat, assume_utc=False, as_utc=False)
        db.set_custom(book_id, viewdate, label=label, commit=True)
    if book_ids:
        self.gui.library_view.model().refresh_ids(book_ids)
chaley is offline   Reply With Quote