![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
Yes/No column with 2 choice only
I have a yes no column for read and unread books. In calibre any new books that are added show up as unread. Where as in calibre companion those books show as blank till I actually I select no. I think this is because calibre keeps the choice blank till filled but shows it as no. Would it be possible to either force calibre to select no instead of blank as default or calibre companion to treat blank as no for a 2 state column.
|
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
@Chaley any comments on this
|
![]() |
![]() |
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
1) that a custom 2-state column never show empty, using calibre's algorithm where empty columns are considered to be "No". 2) that when a 2-state calibre column is synced with the built-in isRead item, the isRead be set to "No" if the column would display as No. That is, both empty and No become No. I will look at these. There are, as usual, complications. Note that the second will have the side effect of when syncing isRead back to calibre, the column in calibre will be set to No, replacing an empty value. |
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
This is much more complicated than I hoped. Two-state columns are a calibre option, not an attribute of the column definition. CC doesn't have access to that option in either the content server or cloud connections. It could have access to it over the wireless device but it currently does not, and in any event is not a general solution.
I am not willing to (try to) change calibre to auto-set 2-state columns to No. This would behavior that has existed for years and could have unhappy knock-on effects. One general solution would be to write another LibraryClosed plugin that checks the option. If it is set then the plugin fetches all the empty values and sets them to No. This scheme ensures that all of the connections see No instead of empty. The downside is that new values will be empty until the library is closed. A second solution is to use bulk edit to set the value of all No columns explicitly to No. This has the downside of setting the last_modified date for the books. A variant of this is to use the "add tag to new books" feature. One would select all books with that tag, set the bool(s) to "No", and remove the tag. A third solution is to set the bools to tri-state, then from time to time select all books with "false" values and set them to No. This avoids the last_modified problem. It also provides a visual indication that something needs to be done. Personally, I would use the third solution, possibly combined with the first. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
My main reason for needing this is that in calibre companion I get three options in grouping column. And so the yes no filter does not work.
A reminder or an option to set the state when using smart eject plugin would be good enough workaround for me. As I only need to set the state for the new books I add. |
![]() |
![]() |
![]() |
#6 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
Maybe you create another custom column to read the info from the read column. If "yes" then returns "Yes", else returns "No". Now you have a column with only Yes/No for the Companion.
But I have no idea how to formulate such template. I'm sure @chaley can help. He did give me two templates. ![]() I myself can only think of {#readstatus:contains(Yes, Yes, No)} Last edited by nqk; 10-11-2016 at 05:35 AM. |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Make a composite column (column built from other columns) with the template, replacing #mybool2 with the lookup name of your Yes/No column:
|
|
![]() |
![]() |
![]() |
#8 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
I elaborated this idea as follows:
Input format of #readstatus: person (date). If I dropped reading of certain book, I just enter my name, like NQK!. I created another composite column: {#readstatus:contains(NQK \(, Yes, {#readstatus:contains(NQK!, Dropped, Pending)})} It works. ![]() Last edited by nqk; 10-12-2016 at 01:11 AM. |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
Well this still doesn't solve the bug in calibre companion where a 2 state column has 3 states.
Sent from my SM-G925I using Tapatalk |
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
|
After thinking about it the easiest option is for me is to probably to go with tri state column. As that will match calibre and calibre companion. And I will have a visual indicator that I need to change something.
Btw you are correct in not wanting to change how calibre used to work earlier as this would probably break stuff for other users. Maybe a tweak could work where you can set what you want the entry to be when a book is first added.That way the default for calibre wont change but people could have the option to change. |
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Your solution is what I was just going to suggest. That way you can use smart eject to find the books that need to be changed.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Single column ePUB becomes 2 column when converted to Kindle (mobi) | rmcape | Conversion | 0 | 09-21-2013 12:52 PM |
Using "Build column from other column" custom-column type | HFC3 | Library Management | 3 | 07-07-2013 03:11 AM |
how to move value(s) of tag column to a custom made column | zoorakhan | Library Management | 0 | 12-08-2012 03:53 AM |
Need help with programming a column based on previous data in the same column | seaquay | Library Management | 2 | 06-13-2012 12:19 PM |
Q: multi-column PDF to single column mobi format converstion | auburn1975 | Calibre | 7 | 01-28-2012 06:11 PM |