Commit Graph

110 Commits

Author SHA1 Message Date
Kjartan Oli Agustsson 2c4221ecfa
Bump version
* calibre.el:
* doc/version.texi:

  Change version to 1.3.4
2023-12-12 11:02:29 +00:00
Kjartan Oli Agustsson b749cf57d4
Fix order of elements in defcustom type
* calibre-book.el (calibre-format-preferences): Move tag before the
  type.
2023-12-12 11:01:13 +00:00
Kjartan Oli Agustsson 6815074635
Add searching by title to composite filters
* calibre-search.el (calibre-search-compose-title): New function.
  (calibre-search-compose): Add a menu entry for searching by title.

* etc/NEWS: Mention this fix.
2023-12-12 10:58:23 +00:00
Kjartan Oli Agustsson 9e532313c9
Handle invalid timestamps
* calibre-db.el (calibre-db--parse-timestamp): Return nil instead of
  signalling an error when calling parse-iso8601-time-string with an
  invalid string.

* calibre-core.el (calibre-book--print-info): Check that pubdate is
  non-nil before attempting to format it.

* etc/NEWS: Mention the fixing of this bug.

Some time strings which parse successfully (although potentially to
nonsensical time stamps) on GNU/Linux signal an error on Windows,
making it impossible to open the *Library* buffer if a library
contains a book with such a time string.
2023-12-12 10:56:45 +00:00
Kjartan Oli Agustsson 4422899b7d
Add author and commentary to calibre-edit.el
* calibre-edit.el: Add author information.
  Add a short commentary section.
2023-10-29 22:30:32 +00:00
Kjartan Oli Agustsson ac7170e09e
Add a docstring to calibre-library-revert
* calibre-library.el (calibre-library-revert): Add a docstring.
2023-10-29 22:30:15 +00:00
Kjartan Oli Agustsson 4f980e2161
Reduce usage of cl-* functions
* calibre-cli.el (calibre-cli--get-authors):
  (calibre-cli--get-tags):
  (calibre-cli--get-formats):
* calibre-core.el (calibre--get-filter-items):
  (calibre-library--filter):
* calibre-search.el (calibre-search--operation):

  Replace cl-* functions with equivalent seq-* functions.
2023-10-29 22:17:13 +00:00
Kjartan Óli Ágústsson dae6a54a38
Add NEWS and TODO list
* etc/NEWS: Add listing of new features.
* etc/TODO: Add listing of items that need to be done.
2023-05-21 21:37:09 +00:00
Kjartan Óli Ágústsson ad65bf9b51
Bump package version to 1.3.3
* calibre.el: Bump package version to 1.3.3
2023-05-20 23:35:06 +00:00
Kjartan Óli Ágústsson 49f05eedc0
Remove second definition of calibre-series widget
* calibre-widgets.el (calibre-series): Remove second, and incorrect
definition of the series widget which shadowed the correct one.
2023-05-20 23:31:33 +00:00
Kjartan Óli Ágústsson 436e70ac13
Fix docstring quoting
* calibre-cli.el (calibre-cli--get-books): Fix quoting in docstring.
2023-05-20 17:44:40 +00:00
Kjartan Óli Ágústsson 41263e2820
Fix byte compiler warnings
* calibre-cli.el:
Require compat.
Declare json-parse-buffer
* calibre-db.el:
Declare functions sqlite-open and sqlite-select.
* calibre-edit.el:
Require compat.
2023-05-20 17:18:23 +00:00
Kjartan Óli Ágústsson 67b7386841
Move functions from calibre-core to calibre-cli
* calibre-cli.el (calibre-cli--get-titles):
(calibre-cli--get-authors):
(calibre-cli--get-publishers):
(calibre-cli--get-series):
(calibre-cli--get-tags):
(calibre-cli--get-formats):
Move from calibre-core.
Use calibredb to get data instead of the in memory list of books.
* calibre-core.el (calibre-cli--get-titles):
(calibre-cli--get-authors):
(calibre-cli--get-tags):
(calibre-cli--get-formats):
(calibre-cli--get-series):
(calibre-cli--get-publishers):
Move into calibre-cli.
2023-05-20 17:14:05 +00:00
Kjartan Óli Ágústsson 472fb38333
Factor out JSON parsing in calibre-cli
* calibre-cli.el (calibre-cli--list): Add function to parse JSON.
(calibre-cli--get-books): Use calibre-cli--list to get book data.
2023-05-20 17:09:12 +00:00
Kjartan Óli Ágústsson 6ff78d6eca
Use correct author separator in calibre-cli
* calibre-cli.el (calibre-cli--parse-authors): Split on ' & ' instead
of ','.
2023-05-20 16:59:05 +00:00
Kjartan Óli Ágústsson e0f6e49316
Add missing search function to calibre-cli
* calibre-cli.el (calibre-cli--get-title-books): Add
2023-05-20 16:58:11 +00:00
Kjartan Óli Ágústsson 3fa7d264da
Use constant instead of magic value
* calibre-exec.el (calibre-exec--process-buffer): Create new constant
to store the name of the output buffer for calibredb processes.
(calibre-exec--process-sentinel): Use calibre-exec--process-buffer
instead of hard coded magic string.

Inform the user of the existence of the output buffer if an error occurs.
(calibre-exec--execute): Use calibre-exec--process-buffer instead of
hard coded magic string.
2023-05-20 16:54:49 +00:00
Kjartan Óli Ágústsson 503e175c54
Document internal variables
* calibre-exec.el (calibre-exec--commands, calibre-exec--executing):
Add docstrings.
2023-05-20 16:54:08 +00:00
Kjartan Óli Ágústsson d7dd1f4d70
Fix copyright header
* doc/calibre.texi: List FSF as copyright holder.
2023-05-20 16:52:37 +00:00
Kjartan Óli Ágústsson 28c605f9dc
Add a manual
* calibre.el: Bump package version to 1.3.2
* doc/calibre.texi: Add manual
* doc/fdl.texi: Add FDL
* doc/version.texi:
2023-05-18 22:19:53 +00:00
Kjartan Óli Ágústsson 22d2791c28
Bump package version to 1.3.1
* calibre.el: Bump package version.
2023-05-18 21:57:04 +00:00
Kjartan Óli Ágústsson d3c379bfff
Allow title filters in virtual libraries
* calibre-virtual-library.el (calibre-virtual-libraries): Add title
option.
2023-05-18 21:56:00 +00:00
Kjartan Óli Ágústsson af41c22f89
Fix copyright header
* README: List FSF as copyright holder.
2023-05-18 21:52:22 +00:00
Kjartan Óli Ágústsson 9df0a29972
Return no books if an inclusive with no matches is defined
* calibre-core.el (calibre-library--filter): Return nil if any
inclusive filters are passed and no books match them.
2023-05-18 18:44:42 +00:00
Kjartan Óli Ágústsson ba5fa17e31
Update copyright headers
* calibre-book.el:
* calibre-cli.el:
* calibre-core.el:
* calibre-db.el:
* calibre-edit.el:
* calibre-exec.el:
* calibre-library.el:
* calibre-search.el:
* calibre-util.el:
* calibre-virtual-library.el:
* calibre-widgets.el:
* calibre.el:
Update copyright headers to list FSF as the copyright holder.
2023-05-18 16:18:56 +00:00
Kjartan Óli Ágústsson c6d0201342
Capture calibredb output
* calibre-exec.el (calibre-exec--process-sentinel): Kill the process
buffer if execution was successful.  This ensures that only the output
of the failed command is present in the output buffer.
(calibre-exec--execute): Call make-process with a :buffer argument.
2023-05-18 16:07:46 +00:00
Kjartan Óli Ágústsson cc66ec42bf
Remove seemingly unnecessary require
* calibre-exec.el: Don't require cl-macs during compilation.  The byte
compiler seems to stay silent if this is removed.
2023-05-18 16:06:43 +00:00
Kjartan Óli Ágústsson 47ae488aed
Drop EIEIO in favor of custom editing solution
* calibre-book.el: Don't require eieio.
(calibre-book): Define using cl-defstruct.
(calibre-book--slot): Delete since cl-defstruct provides this
automatically.
* calibre-cli.el (calibre-cli--make-book): Use the cl-defstruct
provided make-calibre-book.
* calibre-core.el (calibre-book--print-info, calibre-book--file): Drop
the use of EIEIO macro with-slots.
(calibre-core--get-titles, calibre-core--get-authors,
calibre-core--get-tags, calibre-core--get-formats,
calibre-core--get-series, calibre-core--get-publishers): Add an
ignored optional argument to be valid FUN arguments to
completion-table-dynamic.
(calibre-authors-completion-table,
calibre-publishers-completion-table, calibre-series-completion-table,
calibre-tags-completion-table): Create completion tables.
* calibre-db.el (calibre-db--make-book): Use the cl-defstruct provided make-calibre-book.
* calibre-edit.el: Don't require eieio-custom.
Require wid-edit and calibre-widgets.
(calibre-edit--book, calibre-edit--title, calibre-edit--authors,
calibre-edit--publisher, calibre-edit--series, calibre-edit--tags):
Declare variables.
(calibre-edit-apply):
(calibre-edit-abort):
(calibre-edit-reset):
(calibre-edit-confirm):
(calibre-edit-mode-map, calibre-edit-field-keymap): Define keymaps for
editing books.
(calibre-edit-mode): Define a mode for editing books.
(calibre-edit-book):
(eieio-done-customizing): Remove
(calibre-edit--create-buffer): Add function to set up editing buffer.
(calibre-edit--different-fields): Adjust to the cl-lib struct API.
* calibre-widgets.el (calibre-author, calibre-publisher,
calibre-series, calibre-tag, calibre-date): Add widgets.
2023-05-18 15:55:18 +00:00
Kjartan Óli Ágústsson f0324a9d21
Move calibre-parse-timestamp to calibre-db
* calibre-book.el (calibre-parse-timestamp): Rename to calibredb--parse-timestamp.
* calibre-db.el (calibre-db--parse-timestamp): Rename from calibre-parse-timestamp.
(calibre-db--make-book): Call calibre-db--parse-timestamp.
2023-05-18 15:51:30 +00:00
Kjartan Óli Ágústsson b237fd2e5e
Allow searching by title
* calibre-core.el (calibre--get-filter-items): Allow filtering by title.
(calibre-core--get-titles, calibre-cli--get-titles): Create
(calibre-cli--get-series): Adjust indentation.
* calibre-db.el (calibre-db--get-titles, calibre-db--get-title-books):
Create
* calibre-search.el (calibre-library-search-title,
calibre-search-chose-title): Create
2023-05-14 00:05:34 +00:00
Kjartan Óli Ágústsson c07fa7d0f3
Require exact matching in calibre-cli search
* calibre-cli.el (calibre-cli--search-operation): Require exact match
to match calibre-db implementation.
2023-05-14 00:04:12 +00:00
Kjartan Óli Ágústsson f096edd1d3
Return list instead of list of lists
* calibre-db.el (calibre-db--get-authors): Flatten result list.
2023-05-13 23:58:12 +00:00
Kjartan Óli Ágústsson 512b5a1197
Add mode line indicator when updating library
* calibre-library.el (calibre-library-mode): Set mode-line-process.
2023-05-13 23:56:55 +00:00
Kjartan Óli Ágústsson 524ce0353e
Fix docstring
* calibre-search.el (calibre-search--choice-function): Refer to
calibre-core instead of calibre-db.
2023-05-13 23:56:14 +00:00
Kjartan Óli Ágústsson e283a2c928
Use correct separator when setting multiple authors
* calibre-edit.el (calibre-edit--command): Use " & " as a separator
between author names instead of ",", since the former is apparently
the correct syntax for calibredb.
* calibre.el: Bump package version.
2023-05-13 08:39:29 +00:00
Kjartan Óli Ágústsson 8560bbd48b
Sort in ascending order by series index
* calibre-book.el (calibre-book-sort-by-series): Sort in ascending
order by series index.
2023-05-13 08:36:03 +00:00
Kjartan Óli Ágústsson ca0ae8a1d3
Pick some format if no preferred format is available
* calibre-book.el (calibre-book--pick-format): Pick some available
format, if none of the user's preferred formats are available.
2023-05-12 16:17:37 +00:00
Kjartan Óli Ágústsson b43ab3a90c
Allow overriding format preferences
* calibre-library.el (calibre-library-open-book,
calibre-library-open-book-other-window): Prompt for format if called
with a prefix argument.
2023-05-12 16:14:05 +00:00
Kjartan Óli Ágústsson fd949f1813
Set name of calibre-library-mode
* calibre-library.el (calibre-library-mode): Set display name.
2023-05-12 15:50:34 +00:00
Kjartan Óli Ágústsson 4069bbfd10
Bump package version
* calibre.el: Bump package version.
2023-05-11 23:52:30 +00:00
Kjartan Óli Ágústsson 187685e08e
Use cond instead of cl-case
* calibre-library.el (calibre-library-execute): Use cond instead of
cl-case when matching marks.

cl-case does not evaluate its keys, and as such is unsuited to
matching non-literal constants such as calibre-mod-marker and
calibre-del-marker.
2023-05-11 23:47:24 +00:00
Kjartan Óli Ágústsson 090b28d6ec
Use int-to-string instead of format
* calibre-edit.el (calibre-edit--command): Use int-to-string instead
of (format "%d" ...).
2023-05-11 23:46:18 +00:00
Kjartan Óli Ágústsson 8ae08bd7fb
Update README
* README: Mention the ability to modify metadata.
Mention the ability to use the CLI interface instead of SQLite.
2023-05-09 12:43:58 +00:00
Kjartan Óli Ágústsson 13141efce4
Bump package version
* calibre.el: Bump package version.
2023-05-09 12:31:43 +00:00
Kjartan Óli Ágústsson 521fc7471b
Add faces to make library buffer easier to parse
* calibre-library.el (calibre-library-mode): Set font lock keywords
for library buffer.
* calibre.el (calibre-faces): Create group.
(calibre-modified, calibre-modified-face, calibre-flagged,
calibre-flagged-face): Create faces.
(calibre-font-lock-keywords): Create font lock keywords.
2023-05-09 12:26:54 +00:00
Kjartan Óli Ágústsson 3e9b74bfd4
Use constants instead of magic literals for marks
* calibre-edit.el (eieio-done-customizing): Use calibre-mod-marker.
* calibre-library.el (calibre-library-mark-remove,
calibre-library-execute): Use calibre-del-marker and calibre-mod-marker.
* calibre.el (calibre-del-marker, calibre-mod-marker): Create.
2023-05-09 12:26:27 +00:00
Kjartan Óli Ágústsson 3a7abbee56
Use compat to lower required Emacs version
* calibre-library.el: Use compat.
* calibre.el: Lower required Emacs version.
Add dependency on compat.
2023-05-09 11:14:31 +00:00
Kjartan Óli Ágústsson 832e91827d
Move calibre--library to calibre-util
* calibre-util.el: Require calibre to fix byte compilation warning.
(calibre--library): Create/Move from somewhere.
(calibre-select-library): Declare function.
2023-05-09 11:04:28 +00:00
Kjartan Óli Ágústsson 0e7221461b
Add ability to use CLI interface instead of SQLite
* calibre-cli.el:
(calibre-cli--get-books):
(calibre-cli--make-book):
(calibre-cli--parse-authors):
(calibre-cli--parse-timestamp):
(calibre-cli--parse-formats):
(calibre-cli--parse-path):
(calibre-cli--parse-file-name):
(calibre-cli--search-operation):
(calibre-cli--get-series-books):
(calibre-cli--get-publisher-books):
(calibre-cli--get-format-books):
(calibre-cli--get-tag-books):
(calibre-cli--get-author-books):
(calibre-cli--get-calibre-cli-books):
Create.
2023-05-09 10:59:24 +00:00
Kjartan Óli Ágústsson 48fc9eb57b
Don't create buffer for processes
* calibre-exec.el (calibre-exec--execute): Don't create buffer for
calibredb processes.
2023-05-09 10:56:07 +00:00