View Single Post
Old 04-01-2023, 10:46 AM   #5
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by igorius View Post
{
'name': 'column_status',
'label': 'Reading status column:',
'tooltip': 'A regular “text” column to store the reading status of the\n'
'book, as entered on the book status page (“Finished”,\n'
'“Reading”, “On hold”
).',
'type': 'text', (*1)
'sidecar_property': ['summary', 'status'],
}


What types do i have for changing columns? Where is that documented? I didnt find anything in help/plugins or plugin API...
Looks like your changes are correct, using 'type': 'bool'.
The problem is that the information is coming from the device as text (look at the red text above). So, you need to treat this in the 'action.py' file.

Looking at the plugin's code, I would suggest changing the 'sync_to_calibre' method. Here is a possible solution:

Original:
Code:
def sync_to_calibre(self):
...
  keys_values_to_update[target] = value
...
Altered:
Code:
def sync_to_calibre(self):
...
  if value in ('Finished', 'Reading', 'On hold'):
    if value == 'Finished':
      value =  True
    else:
      value = False

  keys_values_to_update[target] = value
...
thiago.eec is offline   Reply With Quote