From b4d6012e2382d792384c40ab42c9ca70bdf03a11 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:17:20 +0800 Subject: [PATCH] OPDS: show author and price in feed --- src/library.js | 3 ++- src/opds/opds.html | 33 +++++++++++++++++++++++++++++---- src/opds/opds.js | 26 +++++++++++++++++++++----- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/library.js b/src/library.js index f522ae65..8ddb38d0 100644 --- a/src/library.js +++ b/src/library.js @@ -31,6 +31,7 @@ const uiText = { 'http://opds-spec.org/acquisition/borrow': _('Borrow'), 'http://opds-spec.org/acquisition/subscribe': _('Subscribe'), }, + openAccess: _('Free'), pagination: [ _('First'), _('Previous'), @@ -452,7 +453,7 @@ GObject.registerClass({ const initFuncs = [ webView.provide('formatMime', format.mime), webView.provide('formatPrice', - ({ currency, value }) => format.price(currency, value)), + price => price ? format.price(price.currency, price.value) : ''), webView.provide('formatLanguage', format.language), webView.provide('formatDate', format.date), webView.provide('formatList', format.list), diff --git a/src/opds/opds.html b/src/opds/opds.html index c7b2e26f..4fff20a0 100644 --- a/src/opds/opds.html +++ b/src/opds/opds.html @@ -428,6 +428,8 @@

display: grid; grid-row: auto / span 2; grid-template-rows: subgrid; + margin-bottom: 18px; + font-size: .9em; } img { width: 100%; @@ -436,10 +438,29 @@

border: 1px solid color-mix(in hsl, currentColor, transparent 85%); align-self: end; } + div { + display: flex; + flex-direction: column; + gap: .3em; + margin-top: 12px; + min-width: 0; + } + div > * { + margin: 0; + } h1 { + font-size: 1em; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + #author { font-size: smaller; - margin-top: 12px; - margin-bottom: 18px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } a { color: inherit; @@ -452,8 +473,12 @@

inset: 0; } - -

+ +
+

+

+

+