View Single Post
Old 09-20-2020, 06:13 PM   #914
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,024
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I dunno--you're using features I've never used and I didn't write it, so...

The relevant block of code appears to be:
Spoiler:

Code:
    def _rebuild_auto_device_list(self, db, list_name, on_device_ids):
        if DEBUG:
            prints('READING LIST: Auto-populating device list: ', list_name)
        existing_book_ids = set(cfg.get_book_list(db, list_name))
        ids_to_remove = list(existing_book_ids - on_device_ids)
        ids_to_add = list(on_device_ids - existing_book_ids)
        if DEBUG:
            prints('READING LIST: Removing %d ids from automatic list: %s' % (len(ids_to_remove), list_name))
        self.apply_tags_to_list(list_name, ids_to_remove, add=False, modify_action='TAGADDREMOVE')
        if DEBUG:
            prints('READING LIST: Adding %d ids to automatic list: %s' % (len(ids_to_add), list_name))
        # We will force the apply of tags to ALL items on the list, just in case the user
        # has only just specified a tag.
        self.apply_tags_to_list(list_name, list(on_device_ids), add=True, modify_action='TAGADDREMOVE')
        cfg.set_book_list(db, list_name, list(on_device_ids))
        ids_to_remove.extend(ids_to_add)
        return ids_to_remove

The code is explicitly ignoring the list's setting for modify_action when it's an auto-populated list.

That's the only place in the RL code that the apply_tags_to_list(...,modify_action=...) parameter is used, which suggests it was deliberate? (Interestingly, search populated lists explicitly disable updating column/tags from list.)

I think it would do what you want if the modify_action='TAGADDREMOVE' parameters are removed.

Attached is a version with that change. I haven't tested it -- use at your own risk and test it first.

Last edited by JimmXinu; 09-22-2020 at 12:06 PM. Reason: Remove obsolete test version
JimmXinu is offline   Reply With Quote