{"id":13797,"date":"2020-06-15T11:05:46","date_gmt":"2020-06-15T17:05:46","guid":{"rendered":"http:\/\/macblaze.ca\/?p=13797"},"modified":"2021-08-08T12:55:26","modified_gmt":"2021-08-08T18:55:26","slug":"books-read-calibre-web-update","status":"publish","type":"post","link":"https:\/\/macblaze.ca\/?p=13797","title":{"rendered":"Books Read &#038; Calibre Web Update"},"content":{"rendered":"<p>Previously (<a href=\"http:\/\/macblaze.ca\/?p=13488\">Making A \u201cBooks Read\u201d Page<\/a>) I had posted how I added info to the default <a href=\"https:\/\/github.com\/janeczku\/calibre-web\">Calibre Web<\/a> templates to add the Series and Pub date information so I could scrape it. Well, it&#8217;s gotten a bit more complex since then. Someone added a <a href=\"https:\/\/github.com\/janeczku\/calibre-web\/pull\/1443\">similar mod to the Github repository<\/a> which has not yet been incorporated. They didn&#8217;t add the pub dates, but did add the series to a few more pages so I thought I would restate my changes here for future reference.<\/p>\n<h3>\/templates\/shelf.html<\/h3>\n<p>Add both series info and pub date for the <a href=\"https:\/\/macblaze.ca\/?p=13517\">python web scraping program<\/a> to access:<\/p>\n<pre><code>{% if entry.series|length &gt; 0 %}\n    &lt;p class=\"series\"&gt;\n        {{_('Book')}} {{entry.series_index}} {{_('of')}} &lt;a href=\"{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}\"&gt;{{entry.series[0].name}}&lt;\/a&gt;\n    &lt;\/p&gt;\n{% endif %}\n\n\n{% if entry.pubdate[:10] != '0101-01-01' %}\n    &lt;p class=\"publishing-date\"&gt;{{entry.pubdate|formatdate}} &lt;\/p&gt;\n{% endif %}<\/code><\/pre>\n<p>Added around line 45 (just after the {% endif&nbsp; %} for the author section).&nbsp;<\/p>\n<h3>\/templates\/index.html<\/h3>\n<p>Add only series info just for aesthetics (note the code is from the proposed mod and is slightly different):<\/p>\n<pre><code>        {% if entry.series.__len__() &gt; 0 %}\n        &lt;p class=\"series\"&gt;\n          &lt;a href=\"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}\"&gt;\n            {{entry.series[0].name}}\n          &lt;\/a&gt; \n          ({{entry.series_index}})\n        &lt;\/p&gt;\n        {% endif %}\n<\/code><\/pre>\n<p>Added around line  193 <del datetime=\"2020-11-20T02:15:52+00:00\">111 (just after the {% endif&nbsp; %} for the author section). (This might be 36&#8230; there seems to have been a change&#8230;)<\/del><\/p>\n<h3>\/templates\/discover.html<\/h3>\n<pre><code>        {% if entry.series.__len__() &gt; 0 %}\n        &lt;p class=\"series\"&gt;\n          &lt;a href=\"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}\"&gt;\n            {{entry.series[0].name}}\n          &lt;\/a&gt; \n          ({{entry.series_index}})\n        &lt;\/p&gt;\n        {% endif %}\n<\/code><\/pre>\n<p>Added around line 36 (just after the {% endif&nbsp; %} for the author section).<\/p>\n<hr \/>\n<p>I am trying to figure out a way to automate the mods if the main repository doesn&#8217;t decide to incorporate the changes but so far an elegant solution eludes me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previously (Making A \u201cBooks Read\u201d Page) I had posted how I added info to the default Calibre Web templates to add the Series and Pub date information so I could scrape it. Well, it&#8217;s gotten a bit more complex since then. Someone added a similar mod to the Github repository which has not yet been [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false},"categories":[1],"tags":[131],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/13797"}],"collection":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13797"}],"version-history":[{"count":6,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/13797\/revisions"}],"predecessor-version":[{"id":14141,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/13797\/revisions\/14141"}],"wp:attachment":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}