Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2011, 04:50 PM   #1
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Question How can I select books where #language is equal to #original_language?

Hi, I'm a new calibre user and I'm really fascinated about its power tricks...

Nevertheless I cannot make a search, a restriction, a custom column or whatever other kind of "filter" to select my translated vs. original language books.

I've added two custom columns two my database (they're tags-like columns):
+ Language (#language). Language of the e-book (only "Spanish" or "English", I cannot read anything else )
+ Original Language (#original_language). The original Language of the book (much more languages used ).

Then my Translated e-books would be those where #language is not equal to #original_language.

How can I achieve this?

Thank you in advance.
arspr is offline   Reply With Quote
Old 03-15-2011, 01:52 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by arspr View Post
I've added two custom columns two my database (they're tags-like columns):
It is odd that the #original_language is a tag-like column, I would think it can't be both languages originally
Quote:
+ Language (#language). Language of the e-book (only "Spanish" or "English", I cannot read anything else )
+ Original Language (#original_language). The original Language of the book (much more languages used ).

Then my Translated e-books would be those where #language is not equal to #original_language.

How can I achieve this?
Code:
(#original_language:English AND #language:Spanish) OR (#language:English AND #original_language:Spanish)

Quote:
Thank you in advance.
You're welcome.
Starson17 is offline   Reply With Quote
Old 03-15-2011, 04:28 PM   #3
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Quote:
Originally Posted by Starson17 View Post
It is odd that the #original_language is a tag-like column, I would think it can't be both languages originally
Well, I've used tag-like columns in case I get a quite strange book which is written or translated to TWO or more languages at the same time ... (I can only think of some kind of language learning books which have the text in original AND translated themselves)

Quote:
Originally Posted by Starson17 View Post
Code:
(#original_language:English AND #language:Spanish) OR (#language:English AND #original_language:Spanish)
The problem with your code is that you are giving values to each language field...

And I want to check if both fields are equal (or different), no matter which values they have (like If(F65=F66;whatever true; whatever false) in Excel, where it doesn't matter if F65 is "English", "French" or "Sindarin" by the way ).
arspr is offline   Reply With Quote
Old 03-15-2011, 04:39 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by arspr View Post
Well, I've used tag-like columns in case I get a quite strange book which is written or translated to TWO or more languages at the same time ... (I can only think of some kind of language learning books which have the text in original AND translated themselves)
Fine, that's why I added the smile.

Quote:
The problem with your code is that you are giving values to each language field...
Yes.

Quote:
And I want to check if both fields are equal (or different), no matter which values they have (like If(F65=F66;whatever true; whatever false) in Excel, where it doesn't matter if F65 is "English", "French" or "Sindarin" by the way ).
You can't "check if both fields are equal (or different), no matter which values they have." You wrote:"(only "Spanish" or "English", I cannot read anything else )" so I used that to write a search you can do. (You can add more languages to the search by searching on the negated language instead of the "other" language.)

(Edit: You can do SQL searches in metadata.db to get the answer you want, but you won't see the results in the GUI window.)

Last edited by Starson17; 03-15-2011 at 04:46 PM.
Starson17 is offline   Reply With Quote
Old 03-15-2011, 05:06 PM   #5
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Perfect,

As nowadays I only have "No language" (Ghosting Test.pdf), English and Spanish books, I've used the next search:

Original books:
Code:
(#language:False AND #original_language:False) OR (#language:"English" AND #original_language:"English") OR  (#language:"Spanish" AND #original_language:"Spanish")
Translated books:
Code:
NOT((#language:False AND #original_language:False) OR (#language:"English" AND #original_language:"English") OR  (#language:"Spanish" AND #original_language:"Spanish"))
And both work perfectly. I've just saved them as searches/restrictions.




When I learn German, Russian and Chinese, I will think about modifying my "not-so-perfect" search
arspr is offline   Reply With Quote
Old 03-15-2011, 05:46 PM   #6
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: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Starson17 View Post
You can't "check if both fields are equal (or different), no matter which values they have."
If this is really important, you can create a composite column that compares the other columns and produces 'yes' or 'no' as appropriate. The 'strcmp' function makes this reasonably straightforward.
chaley is offline   Reply With Quote
Old 03-16-2011, 08:57 AM   #7
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by chaley View Post
If this is really important, you can create a composite column that compares the other columns and produces 'yes' or 'no' as appropriate. The 'strcmp' function makes this reasonably straightforward.
Yes, and he can do SQL based searches using the command line functions, similar to the way duplicate searches can be done. I also wondered why not just leave #language blank when #original_language has an entry to indicate that the book it didn't need translation and search for the negation of that combination to indicate it did need translation.
Starson17 is offline   Reply With Quote
Old 03-16-2011, 02:31 PM   #8
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Quote:
Originally Posted by chaley View Post
If this is really important, you can create a composite column that compares the other columns and produces 'yes' or 'no' as appropriate. The 'strcmp' function makes this reasonably straightforward.


I've got it!!!!.
  1. I've created a new "Original Language?"(#original) custom column with Show checkmarks and Yes/No sorting
  2. I've used the next template (after quite a lot of tests):
    Code:
    {#original:'strcmp(field('#original_language'), field('#language'), 'No', 'Yes', 'No')'}

And it works. (I can delete my previous not-so-perfect searches)

Thanks to both with your help.





:

Now, just like my other ask about title an author-like custom columns, may I ask for other little improvements in Calibre?
  • I would like to see this new column in tag browser but it seems impossible...
  • With the selected "Show Checkmarks" option I get more or less either "Y Yes" or "X No". And I would like to see just either Y or X, I mean not seeing the text, just the icon like any other Yes-No user column.
arspr is offline   Reply With Quote
Old 03-19-2011, 12:20 PM   #9
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Quote:
Originally Posted by arspr View Post
:

Now, just like my other ask about title an author-like custom columns, may I ask for other little improvements in Calibre?
  • I would like to see this new column in tag browser but it seems impossible...
  • With the selected "Show Checkmarks" option I get more or less either "Y Yes" or "X No". And I would like to see just either Y or X, I mean not seeing the text, just the icon like any other Yes-No user column.
You've done it in 0.7.50

arspr is offline   Reply With Quote
Old 03-19-2011, 12:33 PM   #10
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: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
And you can also now see #original in the tag browser. Go to preferences -> columns, select the column, push the blue I button to edit it, and select 'show in tag browser'.
chaley is offline   Reply With Quote
Old 03-20-2011, 03:38 AM   #11
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Guys, you've got a serious problem... You actually achieve what your users ask for. In this way you are never going to finish the development... (In Spanish there's an idiom: "Against the vice of asking, the virtue of not giving")

But as you don't follow it, here you have another suggestion.

Perfect, now I can show "Original Language?" in browser. "Original Language?" is just a "cooked" No/Yes type column. But I cannot show "Read?". As you can imagine, "Read?" is just an ordinary "No/Yes"-type added column.

So, would it be possible to add the new "Show tags in browser" option to every other custom column type?

(Also, if possible, please don't forget about my desired author and title like custom columns)
arspr is offline   Reply With Quote
Old 03-20-2011, 04:48 AM   #12
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by arspr View Post
Guys, you've got a serious problem... You actually achieve what your users ask for. In this way you are never going to finish the development... (In Spanish there's an idiom: "Against the vice of asking, the virtue of not giving")
While some of the active users here are Calibre developers, there are also normal users around here. So development should be safe, I think.

Quote:
(Also, if possible, please don't forget about my desired author and title like custom columns)
There's no need to include a link to that thread in every post you make. As you have noticed, the developers are active forum users, and if one of them is interested, they'll implement it. If not, you would probably have to do the work yourself. If you really fear you're being ignored, you might look into opening a ticket requesting the enhancement in the Calibre bug tracker.
Manichean is offline   Reply With Quote
Old 03-20-2011, 04:51 AM   #13
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: 11,731
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by arspr View Post
So, would it be possible to add the new "Show tags in browser" option to every other custom column type?
Possible, yes. Difficult, yes. In fact, difficult enough where I am not going to attempt it. You can get equivalent functionality by creating a composite column that mirrors the bool column, marking it as shown in tag browser, then hiding the column so it takes no space in the library view.
Quote:
(Also, if possible, please don't forget about my desired author and title like custom columns)
As a) this too is difficult with lots of internal ramifications, b) I have no personal use for it, and c) as it can be done with templates at the cost of having a second column, I will leave it to some other developer.
chaley is offline   Reply With Quote
Old 03-20-2011, 10:01 AM   #14
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Quote:
Originally Posted by chaley View Post
Possible, yes. Difficult, yes. In fact, difficult enough where I am not going to attempt it. You can get equivalent functionality by creating a composite column that mirrors the bool column, marking it as shown in tag browser, then hiding the column so it takes no space in the library view.
Thanks for the tip. Nevertheless, this has an undesirable side effect. Now your shown column is the "templated" one. So you can't change the "Yes/No/No value" directly from the main table view. When you click on the "templated" Yes/No icon you open the Template editor.

Nevertheless a minor possible tweak in . As you say, probably it's not worth the coding effort at all.

Quote:
Originally Posted by chaley View Post
As a) this too is difficult with lots of internal ramifications, b) I have no personal use for it, and c) as it can be done with templates at the cost of having a second column, I will leave it to some other developer.
As you say I supposed it is really difficult.

Nevertheless, I feel it would be a really useful feature at least for Translator(s)-like fields (or "Editor(s), or "Cover Artist(s)", or "The friend(s) who bought me the book", or whatever).

Unless you can give a really, REALLY good hint, I feel the template coding can be really painful because you have to:
  • Replicate the sorting by family name behaviour. I feel it can be more or less easily replicable using two added columns (one for the name, and the second one for the sorted name).
  • Replicate the & behaviour. Author(s) is not exactly just a "Text" field, because it knows that "J.R.R. Tolkien & Christopher Tolkien" are in fact two people, I mean, two "Text fields" merged together. (And also that "A & B & C" are not two but three people...)
    As you can imagine I'm no expert, but replicating this behaviour feels like a HUGE PITA, because you can't use a fixed number of additional columns.

I do agree that the title-like behaviour doesn't worth the effort just to achieve an automatic conversion/sorting from "A good book" to "good book, A".



Nevertheless, you are the coders of a freeware/donationware software, so obviously, you freely decide when, how or where you spend your coding efforts.
arspr is offline   Reply With Quote
Old 03-20-2011, 10:33 AM   #15
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by arspr View Post
Thanks for the tip. Nevertheless, this has an undesirable side effect. Now your shown column is the "templated" one. So you can't change the "Yes/No/No value" directly from the main table view. When you click on the "templated" Yes/No icon you open the Template editor.
Hide the composite column, not the original one.
Manichean is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Borders - Select books for $5 each jbcohen Deals and Resources (No Self-Promotion or Affiliate Links) 8 12-25-2010 05:53 PM
25% off on select books @ Kobo Books eric11210 Deals and Resources (No Self-Promotion or Affiliate Links) 16 10-31-2010 11:33 AM
Opus ask me to select the language everytime I turn it on tokio2 Bookeen 2 09-17-2010 11:11 AM
Kobo Books: $2 Off Select Titles Acreo Aeneas Deals and Resources (No Self-Promotion or Affiliate Links) 6 09-02-2010 09:35 AM
Sync only select books Carenza Calibre 2 08-10-2010 05:16 PM


All times are GMT -4. The time now is 03:31 AM.


MobileRead.com is a privately owned, operated and funded community.