From: Chris Jaekl Date: Mon, 24 Jan 2022 04:23:30 +0000 (-0500) Subject: Add `arrived` attribute (file creation timestamp) to books table. X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=e37909f3c35b4913e3129915e460873d2cf2286f;p=quanlib.git Add `arrived` attribute (file creation timestamp) to books table. --- diff --git a/book.rb b/book.rb index ea65024..2b93f4b 100644 --- a/book.rb +++ b/book.rb @@ -12,6 +12,7 @@ class Book @@DC_NS_URL = 'http://purl.org/dc/elements/1.1/' @@SERIES_AND_VOLUME_REGEX = /^([A-Z]+)([0-9]+(\.[0-9]+)?)$/ + attr_accessor :arrived attr_accessor :author attr_accessor :classification_id attr_accessor :cover @@ -224,6 +225,8 @@ class Book scan_pdf!(file_name) end + @arrived = File.ctime(file_name) + @classification_id = @store.find_classification(@author.grouping, File.basename(file_name, '.*')) # TODO: Fix horrible hard-coded strings and paths diff --git a/store.rb b/store.rb index f1b7fba..1a33ca3 100644 --- a/store.rb +++ b/store.rb @@ -71,6 +71,7 @@ EOS <