Skip to content

Quick Preferences

kiwidude68 edited this page Mar 3, 2024 · 3 revisions

MobileRead History

Introduction

This plugin provides a way to quickly switch calibre settings without manually clicking through the various calibre Preferences dialogs. Specifically it caters for preferences related to adding books (but could be added to in future if needed).

Some example common use cases:

  • You are importing batches of books with differing filename conventions and want to quickly toggle between various regular expressions for each.
  • You want to quickly toggle which metadata source(s) you are downloading from.

By default I have included two regex patterns - the default calibre one, and a second for handling titles in author [- optional series #] - title format.

Menu

Main Features

  • Add to your toolbar a quick selection dropdown button rather than navigating through the calibre Preferences dialog.
  • Store as many regular expressions file patterns as you wish.
    • Optionally specify a pairing of the swap author name setting with your regular expression.
  • Quickly switch between sets of metadata source preferences.
  • Toggle various other options related to adding books (see below).
  • Keeps in sync with changes made via the Preferences dialog.
  • Customise which menu options are included on the dropdown.
  • Customise keyboard shortcuts.

Configuration

Access the configuration dialog via:

  • Preferences -> Plugins -> User interface action -> Quick Preferences -> Customize plugin
  • Quick Preferences -> Customize...

Configuration Dialog

Option Description
File pattern menu items Define the menu items for import file patterns to flip between.
Optionally enforce a value for the swap author name FN LN preference (see below).
Enabled metatada source menu items Define the menu items for quickly fipping metadata sources.
Include in menu Optionally hide from the Quick Preferences menu for settings you will not change.

The default regular expressions included for file patterns:

Menu Item Regular expression
Title - Author (Default) (?P<title>.+) - (?P<author>[^_]+)
Author [- Series #]- Title ^(?P<author>((?!\s-\s).)+)\s-\s(?:(?:\[\s*)?(?P<series>.+)\s(?P<series_index>[\d\.]+)(?:\s*\])?\s-\s)?(?P<title>[^(]+)(?:\(.*\))?

Available Preferences

Plugin Terminology calibre Preference
Metadata sources Preferences -> Sharing -> Metadata download -> Metadata source
Checkboxes for which are enabled
File patterns Preferences -> Import/export -> Adding books -> Reading metadata
Configure metadata from file name -> Regular expression
Swap author names Preferences -> Import/export -> Adding books -> Reading metadata
Swap author first name and last name when reading author from filename
Read metadata from file Preferences -> Import/export -> Adding books -> Reading metadata
Read metadata from file contents rather than filename
Automerge added books Preferences -> Import/export -> Adding books -> Adding actions
Auto-merge added books if they already exist

Swap Author Names

Some extra explanation for why a heavy user of this plugin might use this feature when importing books and controlling when to swap author name format between FN LN and LN, FN.

The default behavior in the configuration options for this plugin has the Swap Names column checkbox shown as unspecified (solid gray). When you use that menu item from the Quick Preferences plugin menu, it will not modify your current calibre preference swapping author names. The current value of that preference will apply during the import.

However if you were regularly importing batches of books that use a mixture of "FN LN" and "LN, FN" then you might want more control over this in a single menu item click.

The configuration options for this plugin allow you to pair a matching value for the swap names preference with that particular menu item. So you could create additional menu items to ensure for instance that when importing filenames that you know are "FN LN" then you want calibre to swap the names. Then when switching back to the "LN, FN" filename menu item you are wanting calibre to NOT swap the names.

Example Menu Title Swap Names Impact
LN, FN Unspecified Importing will respect whatever "current" setting is for swapping names.
LN, FN No Swap False Sets calibre swap names setting to False. Importing will not swap names.
FN LN Swap True Sets calibre swap names setting to True. Importing will swap author names.

However you should not mix and match approaches - either use Swap Names values on all menu items, or leave them all unspecified. Otherwise you risk getting surprise behavior depending on what the underlying calibre preference was flipped to by whichever of the other menu items you previously selected.

Donations

If you enjoy my calibre plugins or extensions, please feel free to show your appreciation!

paypal

paypal.me/kiwicalibre