catalog builder updates wip
151
resources/catalog/help/epub_mobi/help.html
Normal file
@ -0,0 +1,151 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Creating AZW3 • EPUB • MOBI Catalogs</title>
|
||||
<style type="text/css">
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.0em;
|
||||
font-weight: normal;
|
||||
margin-bottom: 0.25em;
|
||||
margin-top: 0px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
h3 {
|
||||
text-align: center;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui_element {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 95%;
|
||||
}
|
||||
.user-input {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-size: 95%;
|
||||
font-weight: bold;
|
||||
}
|
||||
.code_header {
|
||||
text-indent: 2em;
|
||||
}
|
||||
.code_body {
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
background-color: #EEE;
|
||||
font-size: .9em;
|
||||
margin-left: 2em;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.ui_image {
|
||||
text-align: center;
|
||||
}
|
||||
.help_topic {
|
||||
display: block;
|
||||
}
|
||||
.image_left {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
margin-top: -1em;
|
||||
}
|
||||
hr {
|
||||
clear: both;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1><a name="toc" id="toc"></a>Creating AZW3 • EPUB • MOBI Catalogs </h1>
|
||||
<h2><a href="#selecting_books_to_catalog">Selecting books to catalog</a></h2>
|
||||
<h2><a href="#included_sections">Included sections: Selecting which sections to include in the catalog</a></h2>
|
||||
<h2><a href="#prefixes">Prefixes: Adding a prefix indicating book status</a></h2>
|
||||
<h2><a href="#excluded_books">Excluded books: Ignoring certain books when generating the catalog</a></h2>
|
||||
<h2><a href="#excluded_genres">Excluded genres: Ignoring certain tags as genres when generating the catalog</a></h2>
|
||||
<h2><a href="#other_options">Other options: Specifying thumb size, adding extra information to Descriptions</a></h2>
|
||||
<h2><a href="#custom_catalog_covers">Custom catalog covers</a></h2>
|
||||
<h2><a href="#additional_help_resources">Additional help resources</a></h2>
|
||||
<p>Calibre's Create catalog feature enables you to create a catalog of your library in a variety of formats. This help file describes cataloging options when generating a catalog in <span class="user-input">AZW3</span>, <span class="user-input">EPUB</span> and <span class="user-input">MOBI</span> formats.</p>
|
||||
<hr />
|
||||
<h3><a name="selecting_books_to_catalog" id="selecting_books_to_catalog"></a><a href="#toc">Selecting books to catalog</a></h3>
|
||||
<p><div class="help_topic">If you want <em>all</em> of your library cataloged, remove any search or filtering criteria in the main window. With a single book selected, all books in your library will be candidates for inclusion in the generated catalog. Individual books may be excluded by various criteria; see the <a href="#excluded_genres">Excluded genres</a> section below for more information.</p>
|
||||
<p>If you want only <em>some</em> of your library cataloged, you have two options:</p>
|
||||
<ol>
|
||||
<li>Create a multiple selection of the books you want cataloged. With more than one book selected in calibre's main window, only the selected books will be cataloged.</li>
|
||||
<li>Use the <span class="ui_element">Search</span> field or the <span class="ui_element">Tag Browser</span> to filter the displayed books. Only the displayed books will be cataloged.</li>
|
||||
</ol>
|
||||
<p>To begin catalog generation, select the menu item <span class="ui_element">Convert books|Create a catalog of the books in your calibre library</span>. You may also add a <span class="ui_element">Create Catalog</span> button to a toolbar in <span class="ui_element">Preferences|Interface|Toolbar</span> for easier access to the <span class="ui_element">Generate catalog</span> dialog.</p>
|
||||
<p class="ui_image"><img src="images/catalog_options.png" width="656" height="154" /></p>
|
||||
<p>In <span class="ui_element">Catalog options</span>, select <span class="user-input">AZW3</span>, <span class="user-input">EPUB</span> or <span class="user-input">MOBI</span> as the Catalog format. In the <span class="ui_element">Catalog title</span> field, provide a name that will be used for the generated catalog. If a catalog of the same name and format already exists, it will be replaced with the newly-generated catalog.</p>
|
||||
<p class="ui_image"><img src="images/send_to_device.png" width="342" height="81" /></p>
|
||||
<p>Enabling <span class="ui_element">Send catalog to device automatically</span> will download the generated catalog to a connected device upon completion.</div></p>
|
||||
<hr />
|
||||
<h3><a name="included_sections" id="included_sections"></a><a href="#toc">Included sections</a></h3>
|
||||
<div class="help_topic"><p class="ui_image"><img src="images/included_sections.png" width="641" height="106" /></p>
|
||||
<p>Sections enabled by a checkmark will be included in the generated catalog:</p>
|
||||
<ul>
|
||||
<li> <span class="ui_element">Authors</span> - all books, sorted by author, presented in a list format. Non-series books are listed before series books.</li>
|
||||
<li><strong class="ui_element">Titles</strong> - all books, sorted by title, presented in a list format.</li>
|
||||
<li><strong class="ui_element">Series</strong> - all books that are part of a series, sorted by series, presented in a list format.</li>
|
||||
<li><strong class="ui_element">Genres</strong> - individual genres presented in a list, sorted by Author and Series.</li>
|
||||
<li><strong class="ui_element">Recently Added</strong> - all books, sorted in reverse chronological order. List includes books added in the last 30 days, then a month-by-month listing of added books.</li>
|
||||
<li><strong class="ui_element">Descriptions</strong> - detailed description page for each book, including a cover thumbnail and comments. Sorted by author, with non-series books listed before series books.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr />
|
||||
<h3><a name="prefixes" id="prefixes"></a><a href="#toc">Prefixes</a></h3>
|
||||
<div class="help_topic"><p class="ui_image"><img src="images/prefix_rules.png" width="641" height="178" /></p>
|
||||
<p>Prefix rules allow you to add a prefix to book listings when certain criteria are met. For example, you might want to mark books you've read with a checkmark, or books on your wishlist with an X.</p>
|
||||
<p>The checkbox in the first column enables the rule. <span class="ui_element">Name</span> is a rule name that you provide. <span class="ui_element">Field</span> is either <span class="ui_element">Tags</span> or a custom column from your library. <span class="ui_element">Value</span> is the content of <span class="ui_element">Field</span> to match. When a prefix rule is satisfied, the book will be marked with the selected <span class="ui_element">Prefix</span>.</p>
|
||||
<p>Three prefix rules have been specified in the example above:</p>
|
||||
<ol>
|
||||
<li><span class="user-input">Read book</span> specifies that a book with any date in a custom column named <span class="user-input">Last read</span> will be prefixed with a checkmark symbol.</li>
|
||||
<li><span class="user-input">Wishlist item</span> specifies that any book with a <span class="user-input">Wishlist</span> tag will be prefixed with an X symbol.</li>
|
||||
<li> <span class="user-input">Library books</span> specifies that any book with a value of True (or Yes) in a custom column <span class="user-input">Available in Library</span> will be prefixed with a double arrow symbol.</li>
|
||||
</ol>
|
||||
<p>The first matching rule supplies the prefix. Disabled or incomplete rules are ignored.</p>
|
||||
</div>
|
||||
<hr />
|
||||
<h3><a name="excluded_books" id="excluded_books"></a><a href="#toc">Excluded books</a></h3>
|
||||
<div class="help_topic"><p class="ui_image"><img src="images/excluded_books.png" width="641" height="178" /></p>
|
||||
<p>Exclusion rules allow you to specify books that will not be cataloged.</p>
|
||||
<p>The checkbox in the first column enables the rule. <span class="ui_element">Name</span> is a rule name that you provide. <span class="ui_element">Field</span> is either <span class="ui_element">Tags</span> or a custom column in your library. <span class="ui_element">Value</span> is the content of <span class="ui_element">Field</span> to match. When an exclusion rule is satisfied, the book will be excluded from the generated catalog.</p>
|
||||
<p>Two exclusion rules have been specified in the example above:</p>
|
||||
<ol>
|
||||
<li>The <span class="user-input">Catalogs</span> rule specifies that any book with a <span class="user-input">Catalog</span> tag will be excluded from the generated catalog.</li>
|
||||
<li>The <span class="user-input">Archived Books</span> rule specifies that any book with a value of <span class="user-input">Archived</span> in the custom column <span class="user-input">Status</span> will be excluded from the generated catalog.</li>
|
||||
</ol>
|
||||
<p>All rules are evaluated for every book. Disabled or incomplete rules are ignored.</p>
|
||||
</div>
|
||||
<hr />
|
||||
<h3><a name="excluded_genres" id="excluded_genres"></a><a href="#toc">Excluded genres</a></h3>
|
||||
<div class="help_topic"><p class="ui_image"><img src="images/excluded_genres.png" width="641" height="120" /></p>
|
||||
<p>When the catalog is generated, tags in your database are used as genres. For example, you may use the tags <span class="user-input">Fiction</span> and <span class="user-input">Nonfiction</span>. These tags become genres in the generated catalog, with books listed under their respective genre lists based on their assigned tags. A book will be listed in every genre section for which it has a corresponding tag.</p>
|
||||
<p>You may be using certain tags for other purposes, perhaps a <span class="user-input">+</span> to indicate a read book, or a bracketed tag like <span class="user-input">[Amazon Freebie]</span> to indicate a book's source. The <span class="ui_element">Excluded genres</span> regex allows you to specify tags that you don't want used as genres in the generated catalog. The default exclusion regex pattern <span class="user-input">\[.+\]\+</span> excludes any tags of the form <span class="user-input">[tag]</span>, as well as excluding +, the default tag for read books, from being used as genres in the generated catalog.</p>
|
||||
<p>You can also use an exact tag name in a regex. For example, <span class="user-input">[Amazon Freebie]</span> or <span class="user-input">[Project Gutenberg]</span>. If you want to list multiple exact tags for exclusion, put a pipe (vertical bar) character between them: <span class="user-input">[Amazon Freebie]|[Project Gutenberg]</span>.</p>
|
||||
<p><span class="ui_element"> Results of regex</span> shows you which tags will be excluded when the catalog is built, based on the tags in your database and the regex pattern you enter. The results are updated as you modify the regex pattern.</p>
|
||||
</div>
|
||||
<hr />
|
||||
<h3><a name="other_options" id="other_options"></a><a href="#toc">Other options</a></h3>
|
||||
<div class="help_topic"><p class="ui_image"><img src="images/other_options.png" width="641" height="137" /></p>
|
||||
<p><span class="ui_element">Catalog cover</span> specifies whether to generate a new cover or use an existing cover. It is possible to create a custom cover for your catalogs - see <a href="#custom_catalog_covers">Custom catalog covers</a> for more information. If you have created a custom cover that you want to reuse, select <span class="ui_element">Use existing cover</span>. Otherwise, select <span class="ui_element">Generate new cover</span>.</p>
|
||||
<p><span class="ui_element">Extra Description note</span> specifies a custom column's contents to be inserted into the Description page, next to the cover thumbnail. For example, you might want to display the date you last read a book using a <span class="user-input">Last Read</span> custom column. For advanced use of the Description note feature, see <a href="http://www.mobileread.com/forums/showpost.php?p=1335767&postcount=395" target="new">this post in the calibre forum</a>.</p>
|
||||
<p><span class="ui_element">Thumb width</span> specifies a width preference for cover thumbnails included with Descriptions pages. Thumbnails are cached to improve performance.To experiment with different widths, try generating a catalog with just a few books until you've determined your preferred width, then generate your full catalog. The first time a catalog is generated with a new thumbnail width, performance will be slower, but subsequent builds of the catalog will take advantage of the thumbnail cache.</p>
|
||||
<p><span class="ui_element">Merge with Comments</span> specifies a custom column whose content will be non-destructively merged with the Comments metadata during catalog generation. For example, you might have a custom column <span class="user-input">Author Bio</span> that you'd like to append to the Comments metadata. You can choose to insert the custom column contents <span class="ui_element">before</span> or <span class="ui_element">after</span> the Comments section, and optionally separate the appended content with a horizontal rule separator. Eligible custom column types include <span class="user-input">text</span>, <span class="user-input">comments</span>, and <span class="user-input">composite</span>.</p>
|
||||
</div>
|
||||
<hr />
|
||||
<h3><a name="custom_catalog_covers" id="custom_catalog_covers"></a><a href="#toc">Custom catalog covers</a></h3>
|
||||
<div class="help_topic">
|
||||
<p><img src="images/custom_cover.png" width="208" height="251" class="image_left" />With the <a href="http://www.mobileread.com/forums/showthread.php?t=124219" target="_blank">Generate Cover plugin</a> installed, you can create custom covers for your catalog.</p>
|
||||
<p>To install the plugin, go to <span class="ui_element">Preferences|Advanced|Plugins|Get new plugins</span>.</p>
|
||||
</div>
|
||||
<hr />
|
||||
<h3><a name="additional_help_resources" id="additional_help_resources"></a><a href="#toc">Additional help resources</a></h3>
|
||||
<div class="help_topic"><p>For more information on calibre's Catalog feature, see the MobileRead forum sticky <a href="http://www.mobileread.com/forums/showthread.php?t=118556" target="_blank">Creating Catalogs - Start here</a>, where you can find information on how to customize the catalog templates, and how to submit a bug report.</p>
|
||||
<p>To ask questions or discuss calibre's Catalog feature with other users, visit the MobileRead forum <a href="http://www.mobileread.com/forums/forumdisplay.php?f=238" target="_blank">Calibre Catalogs</a>.</p>
|
||||
<p>Calibre's online user manual can be found <a href="http://manual.calibre-ebook.com/index.html" target="_blank">here</a>.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
resources/catalog/help/epub_mobi/images/catalog_options.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
resources/catalog/help/epub_mobi/images/custom_cover.png
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
resources/catalog/help/epub_mobi/images/excluded_books.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
resources/catalog/help/epub_mobi/images/excluded_genres.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
resources/catalog/help/epub_mobi/images/included_sections.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
resources/catalog/help/epub_mobi/images/other_options.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
resources/catalog/help/epub_mobi/images/prefix_rules.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
resources/catalog/help/epub_mobi/images/send_to_device.png
Normal file
After Width: | Height: | Size: 13 KiB |
@ -1,114 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Untitled Document</title>
|
||||
<style type="text/css">
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.0em;
|
||||
font-weight: normal;
|
||||
margin-bottom: 0.25em;
|
||||
margin-top: 0px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
h3 {
|
||||
text-align: center;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui_element {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
font-size: 90%;
|
||||
}
|
||||
.user-input {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-size: 90%;
|
||||
}
|
||||
.code_header {
|
||||
text-indent: 2em;
|
||||
}
|
||||
.code_body {
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
background-color: #EEE;
|
||||
font-size: .9em;
|
||||
margin-left: 2em;
|
||||
margin-top: 0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1><a name="toc" id="toc"></a>Creating AZW3 • EPUB • MOBI Catalogs </h1>
|
||||
<h2><a href="#selecting_books_to_catalog">Selecting books to catalog</a></h2>
|
||||
<h2><a href="#included_sections">Included sections: Selecting which sections to include in the catalog</a></h2>
|
||||
<h2><a href="#prefixes">Prefixes: Adding a prefix indicating book status</a></h2>
|
||||
<h2><a href="#excluded_books">Excluded books: Ignoring certain books when generating the catalog</a></h2>
|
||||
<h2><a href="#excluded_genres">Excluded genres: Ignoring certain tags as genres when generating the catalog</a></h2>
|
||||
<h2><a href="#other_options">Other options: Specifying thumb size, adding extra information to Descriptions</a></h2>
|
||||
<h2><a href="#additional_help_resources">Additional help resources</a></h2>
|
||||
<hr />
|
||||
<h3><a name="selecting_books_to_catalog" id="selecting_books_to_catalog"></a><a href="#toc">Selecting books to catalog</a></h3>
|
||||
<p>If you want all of your library cataloged, remove any search or filtering criteria by clearing the <span class="ui_element">Search:</span> field in the main window. With a single book selected, all books in your library will be candidates for inclusion in the generated catalog. Individual books may be excluded by various criteria; see the <a href="#excluded_genres">Excluded genres</a> section below for more information.</p>
|
||||
<p>If you want only some of your library cataloged, you have two options:</p>
|
||||
<ol>
|
||||
<li>Create a multiple selection of the books you want cataloged. With more than one book selected in calibre's main window, only the selected books will be cataloged.</li>
|
||||
<li>Use the <span class="ui_element">Search:</span> field or calibre's Tag Browser to filter the displayed books. With a single book selected, only the displayed books will be cataloged.</li>
|
||||
</ol>
|
||||
<hr />
|
||||
<h3><a name="included_sections" id="included_sections"></a><a href="#toc">Included sections</a></h3>
|
||||
<p><img></p>
|
||||
<p>Sections enabled by a checkmark will be included in the generated catalog:</p>
|
||||
<ul>
|
||||
<li> <span class="ui_element">Authors</span> - all books, sorted by author, presented in a list format.</li>
|
||||
<li><strong class="ui_element">Titles</strong> - all books, sorted by title, presented in a list format.</li>
|
||||
<li><strong class="ui_element">Series</strong> - all books in series, sorted by series, presented in a list format</li>
|
||||
<li><strong class="ui_element">Genres</strong> - individual genres presented in a list, sorted by Author and Series</li>
|
||||
<li><strong class="ui_element">Recently Added</strong> - all books, sorted in reverse chronological order. List includes books added in the last 30 days, then a month-by-month listing of added books.</li>
|
||||
<li><strong class="ui_element">Descriptions</strong> - detailed description page for each book, including a cover thumbnail and comments. Sorted by author, with non-series books listed before series books.</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h3><a name="prefixes" id="prefixes"></a><a href="#toc">Prefixes</a></h3>
|
||||
<p><img></p>
|
||||
<p>Prefix rules specify matching criteria and a prefix to use when the criteria is matched.</p>
|
||||
<p>The checkbox in the first column enables the rule. <span class="ui_element">Name</span> is a rule name that you provide. <span class="ui_element">Field</span> is either <span class="ui_element">Tags</span> or a custom column in your library. <span class="ui_element">Value</span> is the content of <span class="ui_element">Field</span> to match. When a prefix rule is satisfied, the book will be marked with the selected symbol in the <span class="ui_element">Prefix</span> column.</p>
|
||||
<p>Three prefix rules have been specified in the example above:</p>
|
||||
<ol>
|
||||
<li><span class="user-input">Read book</span> specifies that a book with any date in a custom column named <span class="user-input">Last read</span> will be prefixed with a checkmark symbol.</li>
|
||||
<li><span class="user-input">Wishlist item</span> specifies that any book with a <span class="user-input">Wishlist</span> tag will be prefixed with an X symbol.</li>
|
||||
<li> <span class="user-input">Library books</span> specifies that any book with a value of True (or Yes) in a custom column <span class="user-input">Available in Library</span> will be prefixed with a double arrow symbol.</li>
|
||||
</ol>
|
||||
<p>The first matching rule supplies the prefix. Disabled or incomplete rules are ignored.</p>
|
||||
<hr />
|
||||
<h3><a name="excluded_books" id="excluded_books"></a><a href="#toc">Excluded books</a></h3>
|
||||
<p><img></p>
|
||||
<p>Exclusion rules specify matching criteria for books that will not be cataloged.</p>
|
||||
<p>The checkbox in the first column enables the rule. <span class="ui_element">Name</span> is a rule name that you provide. <span class="ui_element">Field</span> is either <span class="ui_element">Tags</span> or a custom column in your library. <span class="ui_element">Value</span> is the content of <span class="ui_element">Field</span> to match. When an exclusion rule is satisfied, the book will be excluded from the generated catalog.</p>
|
||||
<p>Two exclusion rules have been specified in the example above:</p>
|
||||
<ol>
|
||||
<li>The <span class="user-input">Catalogs</span> rule specifies that any book with a <span class="user-input">Catalog</span> tag will be excluded from the generated catalog.</li>
|
||||
<li>The <span class="user-input">Archived Books</span> rule specifies that any book with a value of <span class="user-input">Archived</span> in the custom column <span class="user-input">Status</span> will be excluded from the generated catalog.</li>
|
||||
</ol>
|
||||
<p>All rules are evaluated for every book. Disabled or incomplete rules are ignored.</p>
|
||||
<hr />
|
||||
<h3><a name="excluded_genres" id="excluded_genres"></a><a href="#toc">Excluded genres</a></h3>
|
||||
<p><img></p>
|
||||
<p>When the catalog is generated, tags in your database are used as genres. For example, you may have the tags <span class="user-input">Fiction</span> and <span class="user-input">Nonfiction</span> applied to books in your library. These tags become genres in the generated catalog, with all tagged books showing up in their respective genre lists.</p>
|
||||
<p>You may be using certain tags for other purposes, perhaps a <span class="user-input">+</span> to indicate a read book, or a bracketed tag like <span class="user-input">[Amazon Freebie]</span> to indicate a book's source. The <span class="ui_element">Excluded genres</span> regex allows you to specify tags that you don't want used as genres in the generated catalog. The default exclusion regex pattern <span class="user-input">\[.+\]\+</span> excludes any tags of the form <span class="user-input">[tag]</span>, as well as excluding +, the default tag for read books, from being used as genres in the generated catalog.</p>
|
||||
<p>You can also use the exact tag name in a regex. For example, <span class="user-input">[Amazon Freebie]</span> will exclude that tag from the generated catalog. If you want to list multiple exact tags for exclusion, put a pipe character between them: <span class="user-input">[Amazon Freebie]|[Project Gutenberg]</span>.</p>
|
||||
<p>The Results field shows you which tags will be excluded when the catalog is built, based on the tags in your database and the regex you enter.</p>
|
||||
<hr />
|
||||
<h3><a name="other_options" id="other_options"></a><a href="#toc">Other options</a></h3>
|
||||
<p><span class="ui_element">Thumb width</span> specifies a width preference for cover thumbnails included in the Descriptions section. Thumbnails are cached to improve performance. If you want to experiment with different widths, try generating a catalog with just a few books until you've found your optimal width, then generate your full catalog. The first time a catalog is generated with a new thumbnail width, performance will be slower, but subsequent runs will take advantage of the cache.</p>
|
||||
<p><span class="ui_element">Extra note</span> specifies a custom column's contents to be inserted into the Description, opposite the cover. For example, you might want to display the date you last read a book using a <span class="user-input">Last Read</span> custom column. For advanced use of the Description note feature, see <a href="http://www.mobileread.com/forums/showpost.php?p=1335767&postcount=395" target="new">this post in the calibre forum</a>.</p>
|
||||
<p><span class="ui_element">Merge with Comments</span> specifies a custom column whose content will be non-destructively merged with the Comments metadata during catalog generation. For example, you might have a custom column <span class="user-input">Author Bio</span> that you'd like to append to the Comments metadata. You can choose to insert the custom column contents before or after the Comments section, and optionally separate the appended content with a horizontal rule. Eligible custom column types include <span class="user-input">text</span>, <span class="user-input">comments</span>, and <span class="user-input">composite</span>.</p>
|
||||
<hr />
|
||||
<h3><a name="additional_help_resources" id="additional_help_resources"></a>Additional help resources</h3>
|
||||
<p>For more information on calibre's Catalog feature, see the MobileRead forum sticky <a href="http://www.mobileread.com/forums/showthread.php?t=118556">Creating Catalogs - Start here</a>, where you can also find information on how to submit a bug report.</p>
|
||||
<p>To ask questions or discuss calibre's Catalog feature with other users, visit the MobileRead forum <a href="http://www.mobileread.com/forums/forumdisplay.php?f=238">Calibre Catalogs</a>.</p>
|
||||
</body>
|
||||
</html>
|
@ -131,13 +131,14 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
# Look up custom column friendly name
|
||||
rule['field'] = self.eligible_custom_fields[rule['field']]['field']
|
||||
if rule['pattern'] in [_('any value'),_('any date')]:
|
||||
rule_pattern = '.*'
|
||||
rule['pattern'] = '.*'
|
||||
elif rule['pattern'] == _('unspecified'):
|
||||
rule['pattern'] = 'None'
|
||||
if 'prefix' in rule:
|
||||
pr = (rule['name'],rule['field'],rule['pattern'],rule['prefix'])
|
||||
else:
|
||||
pr = (rule['name'],rule['field'],rule['pattern'])
|
||||
|
||||
rule_set.append(pr)
|
||||
opt_value = tuple(rule_set)
|
||||
# Strip off the trailing '_tw'
|
||||
@ -155,12 +156,12 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
Output:
|
||||
self.exclude_genre_results (QLabel): updated to show tags to be excluded as genres
|
||||
"""
|
||||
results = _('No genres will be excluded')
|
||||
if not regex:
|
||||
self.exclude_genre_results.clear()
|
||||
self.exclude_genre_results.setText(_('No genres will be excluded'))
|
||||
self.exclude_genre_results.setText(results)
|
||||
return
|
||||
|
||||
results = _('Regex does not match any tags in database')
|
||||
try:
|
||||
pattern = re.compile((str(regex)))
|
||||
except:
|
||||
@ -188,7 +189,7 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
self.exclude_genre.setText(default[1])
|
||||
break
|
||||
|
||||
def fetchEligibleCustomFields(self):
|
||||
def fetch_eligible_custom_fields(self):
|
||||
self.all_custom_fields = self.db.custom_field_keys()
|
||||
custom_fields = {}
|
||||
custom_fields['Tags'] = {'field':'tag', 'datatype':u'text'}
|
||||
@ -199,6 +200,17 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
'datatype':field_md['datatype']}
|
||||
self.eligible_custom_fields = custom_fields
|
||||
|
||||
def generate_descriptions_changed(self, enabled):
|
||||
'''
|
||||
Toggle Description-related controls
|
||||
'''
|
||||
self.header_note_source_field.setEnabled(enabled)
|
||||
self.thumb_width.setEnabled(enabled)
|
||||
self.merge_source_field.setEnabled(enabled)
|
||||
self.merge_before.setEnabled(enabled)
|
||||
self.merge_after.setEnabled(enabled)
|
||||
self.include_hr.setEnabled(enabled)
|
||||
|
||||
def initialize(self, name, db):
|
||||
'''
|
||||
|
||||
@ -223,7 +235,7 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
self.name = name
|
||||
self.db = db
|
||||
self.all_tags = db.all_tags()
|
||||
self.fetchEligibleCustomFields()
|
||||
self.fetch_eligible_custom_fields()
|
||||
self.populate_combo_boxes()
|
||||
|
||||
# Update dialog fields from stored options
|
||||
@ -263,6 +275,10 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
# Hook textChanged event for exclude_genre QLineEdit
|
||||
self.exclude_genre.textChanged.connect(self.exclude_genre_changed)
|
||||
|
||||
# Hook Descriptions checkbox for related options, init
|
||||
self.generate_descriptions.clicked.connect(self.generate_descriptions_changed)
|
||||
self.generate_descriptions_changed(self.generate_descriptions.isChecked())
|
||||
|
||||
# Init self.merge_source_field_name
|
||||
self.merge_source_field_name = ''
|
||||
cs = unicode(self.merge_source_field.currentText())
|
||||
@ -448,7 +464,7 @@ class PluginWidget(QWidget,Ui_Form):
|
||||
'''
|
||||
Display help file
|
||||
'''
|
||||
url = 'file:///' + P('catalog/help_epub_mobi.html')
|
||||
url = 'file:///' + P('catalog/help/epub_mobi/help.html')
|
||||
open_url(QUrl(url))
|
||||
|
||||
class CheckableTableWidgetItem(QTableWidgetItem):
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>650</width>
|
||||
<width>658</width>
|
||||
<height>603</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -304,142 +304,9 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
<property name="title">
|
||||
<string>Other options</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>175</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Thumb width:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>merge_source_field</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="thumb_width">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>137</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Size hint for cover thumbnails included in Descriptions section.</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> inch</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>E&xtra note:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>header_note_source_field</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="header_note_source_field">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Custom column source for text to include in Description section.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>175</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Merge with Comments:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>merge_source_field</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="merge_with_comments_hl">
|
||||
<item>
|
||||
<widget class="QComboBox" name="merge_source_field">
|
||||
<property name="minimumSize">
|
||||
@ -468,6 +335,9 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
<property name="text">
|
||||
<string>&Before</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>merge_options_bg</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -478,6 +348,9 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
<property name="text">
|
||||
<string>&After</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>merge_options_bg</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -493,30 +366,55 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
<string>Separate Comments metadata and additional content with a horizontal rule.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Separator</string>
|
||||
<string>Include &Separator</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>175</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Merge with Comments:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>merge_source_field</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>175</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Catalog cover:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="replace_cover_hl">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>175</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Catalog cover:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="generate_new_cover">
|
||||
<property name="text">
|
||||
@ -525,6 +423,9 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>cover_options_bg</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -532,6 +433,130 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
<property name="text">
|
||||
<string>Use existing cover</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>cover_options_bg</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="spacer_label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>E&xtra Description note:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>header_note_source_field</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="header_note_source_field">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Custom column source for text to include in Description section.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Thumb width:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>merge_source_field</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="thumb_width">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Size hint for cover thumbnails included in Descriptions section.</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> inch</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -543,4 +568,8 @@ The default pattern \[.+\]|\+ excludes tags of the form [tag], e.g., [Test book]
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="cover_options_bg"/>
|
||||
<buttongroup name="merge_options_bg"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -17,4 +17,6 @@ FIELDS = ['all', 'title', 'title_sort', 'author_sort', 'authors', 'comments',
|
||||
TEMPLATE_ALLOWED_FIELDS = [ 'author_sort', 'authors', 'id', 'isbn', 'pubdate', 'title_sort',
|
||||
'publisher', 'series_index', 'series', 'tags', 'timestamp', 'title', 'uuid' ]
|
||||
|
||||
class AuthorSortMismatchException(Exception): pass
|
||||
class EmptyCatalogException(Exception): pass
|
||||
|
||||
|
@ -7,13 +7,14 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, shutil, time
|
||||
import os, shutil, sys, time
|
||||
from collections import namedtuple
|
||||
|
||||
from calibre import strftime
|
||||
from calibre.customize import CatalogPlugin
|
||||
from calibre.customize.conversion import OptionRecommendation, DummyReporter
|
||||
from calibre.ebooks import calibre_cover
|
||||
from calibre.library.catalogs import AuthorSortMismatchException, EmptyCatalogException
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
|
||||
Option = namedtuple('Option', 'option, default, dest, action, help')
|
||||
@ -146,6 +147,13 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
"When multiple rules are defined, the first matching rule will be used.\n"
|
||||
"Default:\n" + '"' + '%default' + '"' + "\n"
|
||||
"Applies to AZW3, ePub, MOBI output formats")),
|
||||
Option('--use-existing-cover',
|
||||
default=False,
|
||||
dest='use_existing_cover',
|
||||
action = 'store_true',
|
||||
help=_("Replace existing cover when generating the catalog.\n"
|
||||
"Default: '%default'\n"
|
||||
"Applies to: AZW3, ePub, MOBI output formats")),
|
||||
Option('--thumb-width',
|
||||
default='1.0',
|
||||
dest='thumb_width',
|
||||
@ -311,7 +319,7 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
'header_note_source_field','merge_comments_rule',
|
||||
'output_profile','prefix_rules','read_book_marker',
|
||||
'search_text','sort_by','sort_descriptions_by_author','sync',
|
||||
'thumb_width','wishlist_tag']:
|
||||
'thumb_width','use_existing_cover','wishlist_tag']:
|
||||
build_log.append(" %s: %s" % (key, repr(opts_dict[key])))
|
||||
|
||||
if opts.verbose:
|
||||
@ -325,16 +333,17 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
if opts.verbose:
|
||||
log.info(" Begin catalog source generation")
|
||||
|
||||
# Returns False if nothing to catalog or author_sort mismatches while building MOBI
|
||||
catalog_source_built = catalog.build_sources()
|
||||
|
||||
if opts.verbose:
|
||||
if catalog_source_built:
|
||||
try:
|
||||
catalog_source_built = catalog.build_sources()
|
||||
if opts.verbose:
|
||||
log.info(" Completed catalog source generation\n")
|
||||
else:
|
||||
log.error(" *** Terminated catalog generation, check log for details ***")
|
||||
except (AuthorSortMismatchException, EmptyCatalogException), e:
|
||||
log.error(" *** Terminated catalog generation: %s ***" % e)
|
||||
except:
|
||||
log.error(" unhandled exception in catalog generator")
|
||||
raise
|
||||
|
||||
if catalog_source_built:
|
||||
else:
|
||||
recommendations = []
|
||||
recommendations.append(('remove_fake_margins', False,
|
||||
OptionRecommendation.HIGH))
|
||||
@ -382,7 +391,7 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
recommendations.append(('cover', cpath, OptionRecommendation.HIGH))
|
||||
log.info("using existing catalog cover")
|
||||
else:
|
||||
log.info("generating new catalog cover")
|
||||
log.info("replacing catalog cover")
|
||||
new_cover_path = PersistentTemporaryFile(suffix='.jpg')
|
||||
new_cover = calibre_cover(opts.catalog_title.replace('"', '\\"'), 'calibre')
|
||||
new_cover_path.write(new_cover)
|
||||
|
@ -12,6 +12,7 @@ from calibre.customize.conversion import DummyReporter
|
||||
from calibre.customize.ui import output_profiles
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, Tag, NavigableString
|
||||
from calibre.ebooks.chardet import substitute_entites
|
||||
from calibre.library.catalogs import AuthorSortMismatchException, EmptyCatalogException
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||
from calibre.utils.config import config_dir
|
||||
from calibre.utils.date import format_date, is_date_undefined, now as nowf
|
||||
@ -20,9 +21,6 @@ from calibre.utils.icu import capitalize, collation_order, sort_key
|
||||
from calibre.utils.magick.draw import thumbnail
|
||||
from calibre.utils.zipfile import ZipFile
|
||||
|
||||
class AuthorSortMismatchException(Exception): pass
|
||||
class EmptyCatalogException(Exception): pass
|
||||
|
||||
class CatalogBuilder(object):
|
||||
'''
|
||||
Generates catalog source files from calibre database
|
||||
@ -499,26 +497,18 @@ class CatalogBuilder(object):
|
||||
Called from gui2.convert.gui_conversion:gui_catalog()
|
||||
|
||||
Args:
|
||||
(none)
|
||||
|
||||
Touches:
|
||||
Exceptions:
|
||||
AuthorSortMismatchException
|
||||
EmptyCatalogException
|
||||
|
||||
Results:
|
||||
error: problems reported during build
|
||||
|
||||
Return:
|
||||
(bool): True: successful build, possibly with warnings
|
||||
False: failed to build
|
||||
"""
|
||||
|
||||
try:
|
||||
self.fetch_books_by_title()
|
||||
except EmptyCatalogException:
|
||||
return False
|
||||
|
||||
try:
|
||||
self.fetch_books_by_author()
|
||||
except AuthorSortMismatchException:
|
||||
return False
|
||||
|
||||
self.fetch_books_by_title()
|
||||
self.fetch_books_by_author()
|
||||
self.fetch_bookmarks()
|
||||
if self.opts.generate_descriptions:
|
||||
self.generate_thumbnails()
|
||||
@ -535,11 +525,11 @@ class CatalogBuilder(object):
|
||||
if self.opts.section_list == ['Genres'] and not self.genres:
|
||||
error_msg = _("No genres to catalog.\n")
|
||||
if not self.opts.cli_environment:
|
||||
error_msg += "Check 'Excluded genres' regex in E-book options.\n"
|
||||
error_msg += _("Check 'Excluded genres' regex in E-book options.\n")
|
||||
self.opts.log.error(error_msg)
|
||||
self.error.append(_('No books available to catalog'))
|
||||
self.error.append(error_msg)
|
||||
return False
|
||||
raise EmptyCatalogException, "No genres to catalog"
|
||||
if self.opts.generate_recently_added:
|
||||
self.generate_html_by_date_added()
|
||||
if self.generate_recently_read:
|
||||
@ -561,9 +551,7 @@ class CatalogBuilder(object):
|
||||
self.generate_ncx_by_date_read(_("Recently Read"))
|
||||
if self.opts.generate_descriptions:
|
||||
self.generate_ncx_descriptions(_("Descriptions"))
|
||||
|
||||
self.write_ncx()
|
||||
return True
|
||||
|
||||
def calculate_thumbnail_dimensions(self):
|
||||
""" Calculate thumb dimensions based on device DPI.
|
||||
@ -799,7 +787,7 @@ class CatalogBuilder(object):
|
||||
|
||||
self.error.append('Author Sort mismatch')
|
||||
self.error.append(error_msg)
|
||||
raise AuthorSortMismatchException
|
||||
raise AuthorSortMismatchException, "author_sort mismatch while building MOBI"
|
||||
else:
|
||||
# Warning if building non-MOBI
|
||||
if not self.error:
|
||||
@ -810,6 +798,7 @@ class CatalogBuilder(object):
|
||||
self.opts.log.warn('\n*** Metadata warning ***')
|
||||
self.opts.log.warn(error_msg)
|
||||
self.error.append(error_msg)
|
||||
continue
|
||||
|
||||
current_author = author
|
||||
|
||||
@ -827,10 +816,9 @@ class CatalogBuilder(object):
|
||||
None: no match
|
||||
"""
|
||||
def _log_prefix_rule_match_info(rule, record):
|
||||
self.opts.log.info(" %s %s by %s (Prefix rule '%s': %s:%s)" %
|
||||
self.opts.log.info(" %s '%s' by %s (Prefix rule '%s')" %
|
||||
(rule['prefix'],record['title'],
|
||||
record['authors'][0], rule['name'],
|
||||
rule['field'],rule['pattern']))
|
||||
record['authors'][0], rule['name']))
|
||||
|
||||
# Compare the record to each rule looking for a match
|
||||
for rule in self.prefix_rules:
|
||||
@ -1168,9 +1156,6 @@ class CatalogBuilder(object):
|
||||
|
||||
# Re-sort based on title_sort
|
||||
if len(titles):
|
||||
#self.books_by_title = sorted(titles,
|
||||
# key=lambda x:(x['title_sort'].upper(), x['title_sort'].upper()))
|
||||
|
||||
self.books_by_title = sorted(titles, key=lambda x: sort_key(x['title_sort'].upper()))
|
||||
|
||||
if self.DEBUG and self.opts.verbose:
|
||||
@ -1184,7 +1169,7 @@ class CatalogBuilder(object):
|
||||
self.opts.log.error('*** ' + error_msg + ' ***')
|
||||
self.error.append(_('No books available to include in catalog'))
|
||||
self.error.append(error_msg)
|
||||
raise EmptyCatalogException
|
||||
raise EmptyCatalogException, error_msg
|
||||
|
||||
def fetch_bookmarks(self):
|
||||
""" Interrogate connected Kindle for bookmarks.
|
||||
@ -2385,6 +2370,9 @@ class CatalogBuilder(object):
|
||||
|
||||
Output:
|
||||
content/BySeries.html (file)
|
||||
|
||||
To do:
|
||||
self.books_by_series = [i for i in self.books_by_title if i['series']]
|
||||
"""
|
||||
friendly_name = _("Series")
|
||||
self.update_progress_full_step("%s HTML" % friendly_name)
|
||||
@ -2414,7 +2402,7 @@ class CatalogBuilder(object):
|
||||
data = self.plugin.search_sort_db(self.db, self.opts)
|
||||
|
||||
# Remove exclusions
|
||||
self.books_by_series = self.process_exclusions(data)
|
||||
self.books_by_series = self.process_exclusions(data, log_exclusion=False)
|
||||
|
||||
if not self.books_by_series:
|
||||
self.opts.generate_series = False
|
||||
@ -4496,13 +4484,16 @@ class CatalogBuilder(object):
|
||||
|
||||
# Report excluded books
|
||||
if self.opts.verbose and excluded_tags:
|
||||
self.opts.log.info(" Excluded books:")
|
||||
self.opts.log.info(" Excluded books by Tags:")
|
||||
data = self.db.get_data_as_dict(ids=self.opts.ids)
|
||||
for record in data:
|
||||
matched = list(set(record['tags']) & set(excluded_tags))
|
||||
if matched :
|
||||
self.opts.log.info(" - '%s' by %s (Exclusion rule Tags: '%s')" %
|
||||
(record['title'], record['authors'][0], str(matched[0])))
|
||||
if matched:
|
||||
for rule in self.opts.exclusion_rules:
|
||||
if rule[1] == 'Tags' and rule[2] == str(matched[0]):
|
||||
self.opts.log.info(" - '%s' by %s (Exclusion rule '%s')" %
|
||||
(record['title'], record['authors'][0], rule[0]))
|
||||
|
||||
return excluded_tags
|
||||
|
||||
def get_friendly_genre_tag(self, genre):
|
||||
@ -4786,7 +4777,7 @@ class CatalogBuilder(object):
|
||||
normalized += c
|
||||
return normalized
|
||||
|
||||
def process_exclusions(self, data_set):
|
||||
def process_exclusions(self, data_set, log_exclusion=True):
|
||||
""" Filter data_set based on exclusion_rules.
|
||||
|
||||
Compare each book in data_set to each exclusion_rule. Remove
|
||||
@ -4817,12 +4808,15 @@ class CatalogBuilder(object):
|
||||
field,
|
||||
index_is_id=True)
|
||||
if field_contents:
|
||||
if re.search(pat, unicode(field_contents),
|
||||
re.IGNORECASE) is not None:
|
||||
if self.opts.verbose:
|
||||
matched = re.search(pat, unicode(field_contents),
|
||||
re.IGNORECASE)
|
||||
if matched is not None:
|
||||
if self.opts.verbose and log_exclusion:
|
||||
field_md = self.db.metadata_for_field(field)
|
||||
self.opts.log.info(" - %s (Exclusion rule '%s': %s:%s)" %
|
||||
(record['title'], field_md['name'], field,pat))
|
||||
for rule in self.opts.exclusion_rules:
|
||||
if rule[1] == '#%s' % field_md['label']:
|
||||
self.opts.log.info(" - '%s' by %s (Exclusion rule '%s')" %
|
||||
(record['title'], record['authors'][0], rule[0]))
|
||||
exclusion_set.append(record)
|
||||
if record in filtered_data_set:
|
||||
filtered_data_set.remove(record)
|
||||
|