Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 09-12-2020, 08:58 AM   #376
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by jony08 View Post
The shortcut Ctrl+Enter used to apply the Add notes window is used by most browsers to select the URL field. Could the shortcut be changed to something else in the Content server?
Ctrl+enter does not select the url field in either chrome or firefox for me.
kovidgoyal is offline  
Old 09-12-2020, 09:14 AM   #377
jony08
Connoisseur
jony08 began at the beginning.
 
Posts: 91
Karma: 10
Join Date: Jun 2016
Device: Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
Ctrl+enter does not select the url field in either chrome or firefox for me.
I don't know how that happened to me earlier.
jony08 is offline  
Old 09-12-2020, 10:22 AM   #378
nixsee
Connoisseur
nixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notes
 
Posts: 79
Karma: 24858
Join Date: Feb 2020
Device: none
I like the new chapter sections for highlights. But I wonder if it is possible to prepend the name of the parent sections to the name, or (even better) have the chapters nested within collapsible parent sections - as is the case with the Table of Contents.

Here's a few highlights that I have from one book that is organized into 4 Parts, each with dozens of chapters. Other than the order there's no indication to know which Part the chapter is from.

Click image for larger version

Name:	chapter highlights.png
Views:	212
Size:	9.8 KB
ID:	181909
nixsee is offline  
Old 09-12-2020, 11:03 AM   #379
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@nixsee yes there is, hover your mouse over the chapter name.
kovidgoyal is offline  
Old 09-12-2020, 11:11 AM   #380
nixsee
Connoisseur
nixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notes
 
Posts: 79
Karma: 24858
Join Date: Feb 2020
Device: none
Ah, great! I didn't realize that was there. Thanks very much for all the hard work and openness to feedback from the peanut gallery!
nixsee is offline  
Old 09-12-2020, 05:50 PM   #381
nixsee
Connoisseur
nixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notesnixsee can name that song in three notes
 
Posts: 79
Karma: 24858
Join Date: Feb 2020
Device: none
I found a bug - highlights aren't always being attributed to the correct chapter. It seems to have to do with the viewer thinking that as soon as the next chapter's title is within view that you are in that chapter. I assume this only applies to Flow Mode, and even then only applies to certain books (as most books seem to only flow until the end of a chapter, whereas this one doesn't do that - I assume there is something off with the chapter tags, but don't know how to (or even want to) fix this for every book that might have this problem.

Here are highlights when the next chapter is not in view.

Click image for larger version

Name:	highlight misaligned2.png
Views:	224
Size:	215.5 KB
ID:	181914


And when you scroll down so that it is in view (note Chpater 12 being bolded in the TOC).

Click image for larger version

Name:	highlight misaligned.png
Views:	212
Size:	186.3 KB
ID:	181913

Even stranger: when I add a new highlight above the previous ones, it registers in chapter 12 because the viewer thinks I'm in that chapter now.

Click image for larger version

Name:	highlight misaligned3.png
Views:	200
Size:	198.3 KB
ID:	181915

Last edited by nixsee; 09-12-2020 at 06:06 PM.
nixsee is offline  
Old 09-13-2020, 07:37 AM   #382
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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
Good to know. What about "raw_field()"? I probably use that as much as "field()".
I rewrote the formatter to build and save an interpretable tree instead of always interpreting while parsing.

Other changes: it
  • inlines raw_field
  • automatically converts test() to if-then-else, avoiding interpreting the non-used expression (branch).
  • improves syntax checking. For example, now that errant semicolon will be signaled regardless of the value of the conditional expression
These changes dramatically improve performance of composite columns and icon/color rules.
chaley is offline  
Old 09-13-2020, 08:42 AM   #383
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
I rewrote the formatter to build and save an interpretable tree instead of always interpreting while parsing.

Other changes: it
  • inlines raw_field
  • automatically converts test() to if-then-else, avoiding interpreting the non-used expression (branch).
  • improves syntax checking. For example, now that errant semicolon will be signaled regardless of the value of the conditional expression
These changes dramatically improve performance of composite columns and icon/color rules.
That sounds very good. Unfortunately, once I updated my source, I got:

Code:
Traceback (most recent call last):
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 633, in safe_format
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 598, in evaluate
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 522, in _eval_program
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 319, in program
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 324, in expression_list
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 424, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 422, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 348, in do_node_if
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 424, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 422, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 365, in do_node_func
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 424, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 422, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 400, in do_node_raw_field
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 392, in do_node_raw_field
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 311, in error
ValueError: Interpreter: Unknown field #pages
Error evaluating column named: #pages1777625035779470211
This appears to be for some column colouring rules using my "Pages" column which has the lookup name "#pages". These re just comparisons to a value. And I have other rules using the column 'Words'/#words. The errors are identical except that the number after the lookup name changes.

And for a test column, using the templates:

Code:
{:'raw_field('#pages')'}
Code:
program:
raw_field('#words')
The latter gives:

Code:
Traceback (most recent call last):
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 633, in safe_format
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 598, in evaluate
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 522, in _eval_program
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 319, in program
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 324, in expression_list
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 424, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 422, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 400, in do_node_raw_field
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 392, in do_node_raw_field
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 311, in error
ValueError: Interpreter: Unknown field #pages
Error evaluating column named: #story_length
davidfor is offline  
Old 09-13-2020, 08:54 AM   #384
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Released version 4.99.16 with the following changes:

- Reduced indentation in tree views
- The highlights panel in the content server viewer now also groups by chapter and shows color swatches
- Fix momentum scrolling not working in the cover grid
- Workaround for Firefox bug that broke searching backwards across file boundaries
- More accurate detection of current toc section when creating highlights
- Improvements to the template parser as detailed by chaley
kovidgoyal is offline  
Old 09-13-2020, 08:56 AM   #385
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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
And for a test column, using the templates:

Code:
{:'raw_field('#pages')'}
Code:
program:
raw_field('#words')
The latter gives:

Code:
Traceback (most recent call last):
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 633, in safe_format
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 598, in evaluate
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 522, in _eval_program
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 319, in program
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 324, in expression_list
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 424, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 422, in expr
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 400, in do_node_raw_field
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 392, in do_node_raw_field
  File "E:\Development\GitHub\calibre\src\calibre\utils\formatter.py", line 311, in error
ValueError: Interpreter: Unknown field #pages
Error evaluating column named: #story_length
The first one in TPM works?

Neither fail for me using an integer column. Would you be willing to send me your metadata.db so I can debug this? If so, send it to calibre at charleshaley dot org.

EDIT: never mind. I installed the newest version of the calibre binary and it fails for me too. Don't know why yet.

Last edited by chaley; 09-13-2020 at 09:10 AM.
chaley is offline  
Old 09-13-2020, 08:58 AM   #386
jony08
Connoisseur
jony08 began at the beginning.
 
Posts: 91
Karma: 10
Join Date: Jun 2016
Device: Kobo Aura
Quote:
Originally Posted by jony08 View Post
IMHO it would be useful to be able to edit the styles in the Add notes window and also to be able to delete the styles that are available from the beginning.
@kovid: Would it be possible to add the ability to edit styles?

Another small thing would be that when you open the search page on the Content Server, the search field should be selected automatically. Is it possible?

Last edited by jony08; 09-13-2020 at 09:05 AM.
jony08 is offline  
Old 09-13-2020, 09:03 AM   #387
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by jony08 View Post
@kovid: Would it be possible to add the ability to edit styles?
Sorry, no.
kovidgoyal is offline  
Old 09-13-2020, 09:08 AM   #388
jony08
Connoisseur
jony08 began at the beginning.
 
Posts: 91
Karma: 10
Join Date: Jun 2016
Device: Kobo Aura
The annotations are not synchronized with the main view from the server and vice versa. Am I doing something wrong? I tried clicking on the Sync button in the controls.

Last edited by jony08; 09-13-2020 at 09:23 AM.
jony08 is offline  
Old 09-13-2020, 09:21 AM   #389
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
The first one in TPM works?
It failed as well. The traceback was common enough that I decided to be lazy. And was to lazy to mention that
Quote:
Neither fail for me using an integer column. Would you be willing to send me your metadata.db so I can debug this? If so, send it to calibre at charleshaley dot org.

EDIT: never mind. I installed the newest version of the calibre binary and it fails for me too. Don't know why yet.
I did the same just in case it need a proper install.

But, it looks like it fails if there isn't a value in the column. This was with a test library and there were a lot of books without either the word or page counts. When I set them for a book, the value in the template column was displayed correctly for the book.
davidfor is offline  
Old 09-13-2020, 09:28 AM   #390
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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
It failed as well. The traceback was common enough that I decided to be lazy. And was to lazy to mention that
Found it, I think. The inlined raw_field didn't handle None-valued fields properly.

If you are willing, try using this code:
Code:
    def do_node_raw_field(self, prog):
        try:
            name = self.expr(prog.expression)
            res = getattr(self.parent_book, name, None)
            if res is not None:
                if isinstance(res, list):
                    fm = self.parent_book.metadata_for_field(name)
                    if fm is None:
                        return ', '.join(res)
                    return fm['is_multiple']['list_to_ui'].join(res)
            return unicode_type(res)
        except ValueError as e:
            raise e
        except:
            self.error(_('Unknown field {0}').format('parse error'))
It goes in utils.formatter.py, replacing the existing method starting at line 387.

EDIT: Kovid accepted the change. It is in source now.

Last edited by chaley; 09-13-2020 at 10:01 AM.
chaley is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beta testers needed kovidgoyal Calibre 75 08-18-2019 07:00 PM
Beta testers for calibre 3.0 needed kovidgoyal Calibre 598 07-09-2017 10:26 PM
Beta testers needed kovidgoyal Calibre 54 05-20-2016 12:34 PM
Windows beta testers needed kovidgoyal Calibre 19 02-08-2016 04:38 PM
Beta testers for calibre 2.0 needed kovidgoyal Calibre 142 05-08-2015 04:44 AM


All times are GMT -4. The time now is 04:05 AM.


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