{"id":14262,"date":"2021-01-19T12:01:52","date_gmt":"2021-01-19T19:01:52","guid":{"rendered":"https:\/\/macblaze.ca\/?p=14262"},"modified":"2024-04-15T09:58:03","modified_gmt":"2024-04-15T15:58:03","slug":"calibre-web-2021","status":"publish","type":"post","link":"https:\/\/macblaze.ca\/?p=14262","title":{"rendered":"Calibre Web 2021"},"content":{"rendered":"<p>A recent update to <a href=\"https:\/\/github.com\/janeczku\/calibre-web\">Calibre Web<\/a> version .6 added the series info, so there is no longer a need to add that to the templates. And they did make a few changes to the code for the publishing date.<\/p>\n<p><strong>Reminder<\/strong> You can edit the script through View Package Contents<\/p>\n<p>Now to add the pub date so my <a href=\"https:\/\/macblaze.ca\/?p=13517\">python web scraping program<\/a> can access it:<\/p>\n<p>After ~line 71 on \/cps\/templates\/shelf.html<\/p>\n<pre><code>\n        {% if (entry.Books.pubdate|string)[:10] != '0101-01-01' %}\n         &lt;p  class=\"series\" id=\"pubdate\"&gt;{{entry.Books.pubdate|formatdate}} &lt;\/p&gt;\n        {% endif %}\n<\/code><\/pre>\n<p>\u2014just after the {% endif\u00a0 %} for the series section.<\/p>\n<p><em>Remember to go to Admin and restart Calibre before exporting.<\/em><\/p>\n<p><strong>Note: updated March 2022<\/strong><br \/>\n&#8211; to change the class to &#8220;series&#8221; to match the previous lines and add an id of &#8220;pubdate&#8221; for the script to search for.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Note: updated July 2022<\/strong><br \/>\n&#8211; changing the class to &#8220;series&#8221; caused &#8220;pubdate&#8221;to show up if there was no series. So I added id=&#8221;series&#8221; to the preceding {if} as well (see below) \u2014 around line 64 \u2014 and then searched for <code>id<\/code> rather than <code>class<\/code> in the python script.<\/p>\n<pre><code>\n        {% if entry.Books.series.__len__() &gt; 0 %}\n        &lt;p id=\"series\" class=\"series\"p&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Note: updated Oct 2022<\/strong><br \/>\nThe source code was changed from <code>entry.pubdate<\/code> to <code>entry.Books.pubdate<\/code> (and all other calls \u2014 see series above)<\/p>\n<p><strong>Note: Update April 2024<\/strong><br \/>\nEdited opds.py to enable Homepage widget: <a href=\"https:\/\/github.com\/janeczku\/calibre-web\/commit\/0499e578cdd45db656da34cd2d7152c8d88ceb23#diff-4ec64b67724eadd1f9c30601b50791079ee157b6bf63c411ce68d637c9793f1dR416-R425\">https:\/\/github.com\/janeczku\/calibre-web\/commit\/0499e578cdd45db656da34cd2d7152c8d88ceb23#diff-4ec64b67724eadd1f9c30601b50791079ee157b6bf63c411ce68d637c9793f1dR416-R425<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A recent update to Calibre Web version .6 added the series info, so there is no longer a need to add that to the templates. And they did make a few changes to the code for the publishing date. Reminder You can edit the script through View Package Contents Now to add the pub date [&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\/14262"}],"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=14262"}],"version-history":[{"count":14,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/14262\/revisions"}],"predecessor-version":[{"id":16030,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/14262\/revisions\/16030"}],"wp:attachment":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}