Commit Graph

40138 Commits

Author SHA1 Message Date
Kovid Goyal cfb2e7566e pep8 2026-04-17 09:44:11 +05:30
Kovid Goyal 073f67522a Merge branch 'codex/add-openai-compatible-provider' of https://github.com/lazydao/calibre 2026-04-17 09:43:29 +05:30
Kovid Goyal 0b91aa8354 ... 2026-04-17 09:41:29 +05:30
Kovid Goyal 5379b5bb62 Cleanup previous PR 2026-04-17 09:19:28 +05:30
Kovid Goyal ad1da12068 Merge branch 'codex/throttle-ai-chat-streaming' of https://github.com/lazydao/calibre 2026-04-17 09:15:30 +05:30
Kovid Goyal ab24d2e152 Native TTS engine: Normalize text to NFKC so that word tracking works when the native engine reports spoken word with different normal form 2026-04-17 08:51:55 +05:30
Kovid Goyal 1a87b70c12 When converting GIF images to PNG workaround bug in PIL causing exception when checking if the GIF is animated. Fixes #2148533 [Failure converting MOBI file to EPUB](https://bugs.launchpad.net/calibre/+bug/2148533) 2026-04-16 13:15:01 +05:30
Kovid Goyal d5c887d569 Use paths for another instance of safe_replace 2026-04-15 04:53:42 +05:30
copilot-swe-agent[bot] dede73a0cc Add tests for safe_replace() in zipfile.py and register in run_tests.py
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/ae87adbf-5df0-4d0c-aeb2-27cb25a97469

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-14 15:04:31 +00:00
Kovid Goyal c5639d4428 Use atomic replace when updating epub files 2026-04-14 20:26:28 +05:30
un-pogaz 51b4739aca clean "running from source" try catch 2026-04-14 10:20:09 +02:00
lazydao b462171750 move AI chat disclaimer out of scroll area 2026-04-14 15:20:55 +08:00
lazydao a40a29936f add streaming render demo for AI chat 2026-04-14 14:40:49 +08:00
lazydao f84f3ca7ba add OpenAI-compatible AI provider 2026-04-14 10:24:18 +08:00
lazydao 04bcc7e7c3 throttle AI chat streaming re-renders 2026-04-14 10:23:04 +08:00
Kovid Goyal 4c1041b23f Preserve existing conversation with AI when there is an error talking to it. Fixes #3085 (Preserve AI chat history when a follow-up request fails) 2026-04-13 20:02:21 +05:30
Kovid Goyal 1914d15fd3 Make clearing conversation optional when showing a message 2026-04-13 19:56:23 +05:30
Kovid Goyal e5e9ad4055 Remove unused code 2026-04-13 19:54:53 +05:30
Kovid Goyal 0d64020b05 Ignore AppleDouble files when looking for missing formats 2026-04-11 09:41:26 +05:30
Kovid Goyal e3c6aef3dd version 9.7.0 2026-04-10 08:08:46 +05:30
copilot-swe-agent[bot] 72f403d52a Fix regression: EPUB annotations not saved due to immediate queue shutdown
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/171c5cc8-db33-468a-9656-d88b8b95ff40

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-08 13:39:27 +00:00
Kovid Goyal fa2cce533d pep8 2026-04-08 08:26:33 +05:30
Kovid Goyal 089dad329a AI: Make the GitHub backend a bit more robust
Fixes #2147495 [Github backend errors silently](https://bugs.launchpad.net/calibre/+bug/2147495)
2026-04-08 08:25:53 +05:30
Kovid Goyal 4242c5c30b Viewer: have the native pinch act exactly the touch screen pinch
Now only on completing the gesture does the font size change.
2026-04-07 19:28:38 +05:30
Kovid Goyal 3013076808 E-book viewer: Handle native pinch to zoom gesture to change font size and persist the changes using the same mechanism as regular font size adjustment 2026-04-07 15:37:30 +05:30
Kovid Goyal 9f0bf3a685 Remove unused code 2026-04-07 14:43:33 +05:30
Kovid Goyal 24a7abd0af Be a bit more robust against external software corrupting calnotes 2026-04-07 07:07:00 +05:30
adar2378 927744673e Fix ValueError in remove_namespaces when tag name contains colon
When an EPUB contains elements with custom namespace prefixes (e.g.
<vita:metadata>), the remove_namespaces method in the KF8 writer
crashes with `ValueError: Invalid tag name 'vita:'`.

The existing except ValueError block only strips colons from attribute
names but does not handle the tag name itself. This causes the second
makeelement call to raise the same ValueError.

Fix: replace colons with hyphens in the tag name before retrying,
consistent with how colon-containing attributes are already handled.
2026-04-05 22:31:26 +06:00
Kovid Goyal ee3166cc5b Fix status tip for context menus not working 2026-04-05 10:26:28 +05:30
Kovid Goyal 89b907546f clone action should also copy status tip 2026-04-05 10:14:13 +05:30
Kovid Goyal f8df3d90db Add status tips to copy to library actions 2026-04-05 10:01:18 +05:30
Kovid Goyal bd4d9390bc Content server: Fix regression causing error during searching. Fixes #2147261 [Search fucntion in calibre server 9.6.0 (search in epub-File) fails, works in 9.3.0](https://bugs.launchpad.net/calibre/+bug/2147261) 2026-04-05 09:40:56 +05:30
ktetzlaff e0324c7ae8 Fix opening a book from the FTS search result dialog
Since version 9.6.0, pressing `v` in the FTS search result pane results in
the following error:

```
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/fts/dialog.py", line 32, in view_current_book
    if not self.results_panel.view_current_result():
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/calibre/calibre/gui2/fts/search.py", line 1062, in view_current_result
    open_book(results, match)
    ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/gui2/fts/search.py", line 115, in open_book
    result_dict = results.result_dicts[match_index]
                  ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not dict
```

I traced this back to commit b10e56d9e5 (Refactor FTS dialog to allow multiple
result visualisations) which refactored `ResultsView.view_current_result` in
`src/calibre/gui2/fts/search.py` from:

``` python
    def view_current_result(self):
        idx = self.currentIndex()
        if idx.isValid():
            results, match = self.m.data_for_index(idx)
            if results:
                if match is not None:
                    match = idx.row()
                open_book(results, match)
                return True
        return False
```

to `ResultsPanel.view_current_result`:

``` python
    def view_current_result(self):
        results, match = self.current_view.current_result()
        if results:
            open_book(results, match)
            return True
        return False
```

and `SplitView.current_result`:

``` python
    def current_result(self):
        idx = self.results_view.currentIndex()
        if idx.isValid():
            results, match = self.results_view.model().data_for_index(idx)
            if match is None:
                match = idx.row()
            return results, match
        return None, None
```

As can be seen in the latter, the condition in the original
`ResultsView.view_current_result`:

``` python
           if match is not None:
                match = idx.row()
```

has changed to:

``` python
           if match is None:
                match = idx.row()
```

in `SplitView.current_result` which is causing the error.

This bug is fixed in the current commit.
2026-04-04 13:55:22 +02:00
Kovid Goyal cef0b976a1 Annots browser: Fix searching with restriction to type of annotation not working 2026-04-04 09:15:26 +05:30
Kovid Goyal fa89d52271 Bump version for preview release 2026-04-03 08:42:43 +05:30
Kovid Goyal 9e05bb1f69 Merge branch 'master' of https://github.com/sgmoore/calibre 2026-04-02 20:27:56 +05:30
Stephen Moore 991e719315 Amended WorkerError custom exception to print all details.
Printing standard tracebacks now includes the original exception.
2026-04-02 15:31:22 +01:00
Kovid Goyal ae0121f210 Fix #2147008 [Openrouter backend - reasoning disabled if set to auto](https://bugs.launchpad.net/calibre/+bug/2147008) 2026-04-01 19:24:26 +05:30
copilot-swe-agent[bot] 55e070682c Fix duplicate column names in Show Column and Sort By menus
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/bdadbc3e-805b-48aa-9232-a4c7df75d643

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-01 05:28:50 +00:00
Gabriel Russell ca598395d5 fixing a couple of use-after-free bugs in libmtp.c
o my kindle colorsoft has a ton of books on it, so I'm guessing
  that that is why this crashed popped up.
o there were cases in this file of doing the memory clean up safely,
  so I just copied how it was done there.
2026-03-31 14:55:12 -04:00
Kovid Goyal 6c9ecc6139 Fix search error report dialog being hidden automatically 2026-03-31 23:51:31 +05:30
copilot-swe-agent[bot] 6b0d315653 Content server: Fix opening results from full text search not working. Fixes #2146829
Fixes #3075
2026-03-31 23:46:48 +05:30
Kovid Goyal 3155ae770c ... 2026-03-31 23:05:17 +05:30
copilot-swe-agent[bot] 38252f6435 Fix test_annotations tests to match updated annotation group sorting
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/2fb2b51f-720c-42c9-b99a-bbcadf6bd521

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-31 10:21:37 +00:00
copilot-swe-agent[bot] e7bd5ee3e7 Use rating_to_stars for rating group labels, 'Unrated' for missing/0 values
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/484081a7-d0c9-44da-aabb-4b2e454dc774

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-31 09:34:54 +00:00
copilot-swe-agent[bot] 2a4f8570cd Fix type mismatch in get_group_key for non-text fields (rating, enumeration, etc.)
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/390a940b-78a4-4b27-a1e4-0728a442235e

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-31 09:29:26 +00:00
Kovid Goyal 08a0a9a396 Partial cleanup of previous PR 2026-03-31 14:54:33 +05:30
copilot-swe-agent[bot] f4e5b0f4e5 Merge remote-tracking branch 'origin/master' into copilot/refactor-grouping-code-annotations
# Conflicts:
#	src/calibre/gui2/library/test_annotations.py

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-31 08:39:09 +00:00
copilot-swe-agent[bot] e2a51c3409 Address code review: simplify walrus operator, fix test assertion
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/6c6c56e2-ea78-4bc2-95b1-4ee08f08c1dd

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-31 08:29:02 +00:00
copilot-swe-agent[bot] ccd7d3ffc8 Refactor grouping code in annotations.py - use db prefs, iter_all_groups, and multi-valued field support
Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/6c6c56e2-ea78-4bc2-95b1-4ee08f08c1dd

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-31 08:27:37 +00:00