mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
plug created_at for missing updated_at
This commit is contained in:
parent
bca7ecb95f
commit
50b1ea65e3
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Add table
Reference in a new issue