View Single Post
Old 05-13-2024, 02:53 AM   #1335
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,118
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
There are two solutions:
  1. Create a New chain

    Create a new chain with a single action: "Search Using Templates", using the following Templates:

    Code:
    program:
        if from_search('id', '#reading_status:"=Currently Reading"') then
            '#reading_status:"=Currently Reading"'
        else
            '#reading_status:"=TBR"'
        fi
    Note: Make sure the option "Template output is a calibre search" is chosen.


  2. Modify your existing chain

    Modify you chain as follows:
    • Make sure in the first "Selection Modifier" action the option "Select first book in current view" is selected.
    • Add a second "Selection Modifier" action with this search:

      Code:
      #reading_status:"=TBR"
      Note, however, that you must put this condition on it (Right click > Add/Modify conditions):
      Code:
      template = program: from_selection('id')
      datatype = text
      comparison = "!="
      condition value =
The first solution is the simpler solution. But since your #reading_status is a composite column, I think the second might perform better. Experiment with the two and see what fits you better.

Edit: The two template functions from_search() and from_selection() are only available in Action Chains plugin. @chaley has since introduced a template function called book_values() that can replace from_search().

Last edited by capink; 05-13-2024 at 05:00 AM.
capink is offline   Reply With Quote