plug created_at for missing updated_at

This commit is contained in:
Kyle Drake 2024-05-06 12:02:20 -05:00
parent bca7ecb95f
commit 50b1ea65e3
2 changed files with 3 additions and 1 deletions

View file

@ -31,6 +31,7 @@ get '/api/list' do
new_file[:path] = file[:path]
new_file[:is_directory] = file[:is_directory]
new_file[:size] = file[:size] unless file[:is_directory]
new_file[:created_at] = file[:created_at].rfc2822
new_file[:updated_at] = file[:updated_at].rfc2822
new_file[:sha1_hash] = file[:sha1_hash] unless file[:is_directory]
files << new_file

View file

@ -1248,7 +1248,8 @@ class Site < Sequel::Model
if site_file
file[:size] = site_file.size unless file[:is_directory]
file[:updated_at] = site_file.updated_at
file[:created_at] = site_file.created_at
file[:updated_at] = site_file.updated_at ? site_file.updated_at : site_file.created_at
end
file[:is_html] = !(extname.match(HTML_REGEX)).nil?