From 13e68e23c741ef0b465b06759abe84c1f46a0adb Mon Sep 17 00:00:00 2001 From: zPlus Date: Wed, 20 Nov 2024 13:43:06 +0100 Subject: [PATCH] Remove broken OPDS support from the library. --- app.py | 29 --------- pages/library.html | 3 - pages/templates/library/opds/books.tpl | 77 ------------------------ pages/templates/library/opds/others.tpl | 78 ------------------------- pages/templates/library/opds/root.tpl | 28 --------- 5 files changed, 215 deletions(-) delete mode 100644 pages/templates/library/opds/books.tpl delete mode 100644 pages/templates/library/opds/others.tpl delete mode 100644 pages/templates/library/opds/root.tpl diff --git a/app.py b/app.py index ed3d417..d8dc38a 100755 --- a/app.py +++ b/app.py @@ -187,35 +187,6 @@ def library(): return template('library.html', authors=authors, licenses=licenses, items=items, filters_author=filters_author, filters_license=filters_license) -@bottle.get('/library/opds.xml', name='library_opds') -def library_opds(): - """ - Serve OPDS Atom RSS feeds - """ - - #response.content_type = 'text/xml; charset=utf-8' - return template('templates/library/opds/root.tpl') - -@bottle.get('/library/opds/books.xml', name='library_opds_books') -def library_opds_books(): - """ - Serve OPDS Atom RSS feeds. - Items of type "books" only - """ - - #response.content_type = 'text/xml; charset=utf-8' - return template('templates/library/opds/books.tpl') - -@bottle.get('/library/opds/others.xml', name='library_opds_others') -def library_opds_others(): - """ - Serve OPDS Atom RSS feeds. - Uncategorized items only - """ - - #response.content_type = 'text/xml; charset=utf-8' - return template('templates/library/opds/others.tpl') - @bottle.get('/library/', name='library_item') def library_item(item_id): """ diff --git a/pages/library.html b/pages/library.html index 570f7d1..4e8db50 100644 --- a/pages/library.html +++ b/pages/library.html @@ -6,9 +6,6 @@
-The library is also available via OPDS. Add this link to your OPDS client: https://dokk.org/library/opds.xml -


-
Filters diff --git a/pages/templates/library/opds/books.tpl b/pages/templates/library/opds/books.tpl deleted file mode 100644 index b9df393..0000000 --- a/pages/templates/library/opds/books.tpl +++ /dev/null @@ -1,77 +0,0 @@ - - -{% set data = query(""" - PREFIX library: - PREFIX license: - - CONSTRUCT { - ?item library:title ?title; - library:author ?author ; - library:license ?license . - ?license license:id ?license_id ; - license:name ?license_name . - } - WHERE { - ?item library:type 'book' ; - library:title ?title ; - library:author ?author ; - library:license ?license . - - OPTIONAL { - ?license license:id ?license_id_optional ; - license:name ?license_name_optional . - } - - BIND(COALESCE(?license_id_optional, SUBSTR(STR(?license), 14)) AS ?license_id) - BIND(COALESCE(?license_name_optional, SUBSTR(STR(?license), 14)) AS ?license_name) - } - """, - { - '@context': { - 'library': 'dokk:library:', - 'license': 'dokk:license:', - 'library:author': { '@container': '@set' }, - 'library:license': { '@container': '@set' } - }, - 'library:title': {} - }) -%} - - - - - - - urn:uuid:1ad42a21-f98f-44a9-b37a-7c4496ab661d - DOKK Library Books - {{ now() }} - - DOKK - https://dokk.org - - - {% for item in data["@graph"]|sort(attribute="library:title") %} - - {{ item['library:title'] }} - - {% for author in item["library:author"]|sort() %} - - {{ author }} - - {% endfor%} - - {% for license in item["library:license"]|sort(attribute="license:id") %} - {{ license['license:id'] }} - {% endfor%} - - - - - - - - - {% endfor %} - diff --git a/pages/templates/library/opds/others.tpl b/pages/templates/library/opds/others.tpl deleted file mode 100644 index 93c1025..0000000 --- a/pages/templates/library/opds/others.tpl +++ /dev/null @@ -1,78 +0,0 @@ - - -{% set data = query(""" - PREFIX library: - PREFIX license: - - CONSTRUCT { - ?item library:title ?title; - library:author ?author ; - library:license ?license . - ?license license:id ?license_id ; - license:name ?license_name . - } - WHERE { - ?item library:title ?title ; - library:author ?author ; - library:license ?license . - - FILTER(NOT EXISTS { ?item library:type ?item_type }) - - OPTIONAL { - ?license license:id ?license_id_optional ; - license:name ?license_name_optional . - } - - BIND(COALESCE(?license_id_optional, SUBSTR(STR(?license), 14)) AS ?license_id) - BIND(COALESCE(?license_name_optional, SUBSTR(STR(?license), 14)) AS ?license_name) - } - """, - { - '@context': { - 'library': 'dokk:library:', - 'license': 'dokk:license:', - 'library:author': { '@container': '@set' }, - 'library:license': { '@container': '@set' } - }, - 'library:title': {} - }) -%} - - - - - - - urn:uuid:98d6aff1-0df9-4229-8c6e-2ab0ebece9e1 - DOKK Library Other Materials - {{ now() }} - - DOKK - https://dokk.org - - - {% for item in data["@graph"]|sort(attribute="library:title") %} - - {{ item['library:title'] }} - - {% for author in item["library:author"]|sort() %} - - {{ author }} - - {% endfor%} - - {% for license in item["library:license"]|sort(attribute="license:id") %} - {{ license['license:id'] }} - {% endfor%} - - - - - - - - - {% endfor %} - diff --git a/pages/templates/library/opds/root.tpl b/pages/templates/library/opds/root.tpl deleted file mode 100644 index e4314a4..0000000 --- a/pages/templates/library/opds/root.tpl +++ /dev/null @@ -1,28 +0,0 @@ - - - - urn:uuid:37a3bc53-cce9-47a2-b557-2c2d5b73d915 - DOKK Library - {{ now() }} - - DOKK - https://dokk.org - - - - - - Books - - {{ now() }} - urn:uuid:1ad42a21-f98f-44a9-b37a-7c4496ab661d - - - Other Materials - - {{ now() }} - urn:uuid:98d6aff1-0df9-4229-8c6e-2ab0ebece9e1 - -