aboutsummaryrefslogtreecommitdiff
path: root/lib/plain_exporter.rb
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-08-08 23:14:22 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-08-08 23:14:22 +0200
commit13243d96bf5bf945cb68fe752598abc8a0b0274a (patch)
tree1c6adcfca40086b49f047a5a72450576681c6d6e /lib/plain_exporter.rb
parentc99697a13e714d1ef87f047e5ad1c88f62f61f25 (diff)
downloadoperum-13243d96bf5bf945cb68fe752598abc8a0b0274a.tar.gz
operum-13243d96bf5bf945cb68fe752598abc8a0b0274a.zip
exporter: Avoid trailing dots on bare-bone items
Some items are going to be really empty: just the title and the author; no year, no notes, etc. In these cases the exporter still tried to add this missing information. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/plain_exporter.rb')
-rw-r--r--lib/plain_exporter.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/plain_exporter.rb b/lib/plain_exporter.rb
index 514d243..018c8f2 100644
--- a/lib/plain_exporter.rb
+++ b/lib/plain_exporter.rb
@@ -33,8 +33,11 @@ class PlainExporter < BaseExporter
str += thing.note.present? ? "#{thing.note}. #{thing.publisher}" : thing.publisher
end
+ str = str.strip
if thing.address.present?
str + ", #{thing.address}: #{thing.year}."
+ elsif str.blank?
+ nil
else
"#{str}."
end