diff --git a/app/controllers/admin/assets_controller.rb b/app/controllers/admin/assets_controller.rb index f25e198c6..c4d87aa43 100644 --- a/app/controllers/admin/assets_controller.rb +++ b/app/controllers/admin/assets_controller.rb @@ -104,6 +104,7 @@ def calculate_fixity_report end def fixity_report + @stale_in_days = ScihistDigicoll::AssetsNeedingFixityChecks::DEFAULT_PERIOD_IN_DAYS @fixity_report = FixityReport.new.get_latest if @fixity_report age_in_days_of_fixity_report = (DateTime.now() - DateTime.parse(@fixity_report[:timestamp])).floor diff --git a/app/models/fixity_report.rb b/app/models/fixity_report.rb index 84d70fe0b..21f7d2f59 100644 --- a/app/models/fixity_report.rb +++ b/app/models/fixity_report.rb @@ -9,8 +9,6 @@ class FixityReport < ApplicationRecord # Assets older than EXPECTED_FRESH_IN_DAYS should not be stale, or it's a problem. EXPECTED_FRESH_IN_DAYS = 1 - STALE_IN_DAYS = ScihistDigicoll::AssetsNeedingFixityChecks::DEFAULT_PERIOD_IN_DAYS - # We store video originals in 'video_store' and everything else in 'store'. NOT_STORED_FILE_SQL = "(file_data ->> 'storage' NOT IN ('store', 'video_store') or file_data ->> 'storage' is NULL)" STORED_FILE_SQL = "(file_data ->> 'storage' IN ('store','video_store'))" diff --git a/app/views/admin/assets/fixity_report.html.erb b/app/views/admin/assets/fixity_report.html.erb index 0ae72f3da..b42671b44 100644 --- a/app/views/admin/assets/fixity_report.html.erb +++ b/app/views/admin/assets/fixity_report.html.erb @@ -40,8 +40,8 @@
@@ -103,7 +103,7 @@ - Fully ingested without fresh (within past <%= pluralize FixityReport::STALE_IN_DAYS, 'day' %>) fixity check + Fully ingested without fresh (within past <%= pluralize @stale_in_days, 'day' %>) fixity check <%= number_with_delimiter(@fixity_report[:not_recent_with_no_checks_or_stale_checks]) %> <% if @fixity_report[:not_recent_with_no_checks_or_stale_checks] == 0 %> @@ -165,12 +165,12 @@ - Fully ingested, checked in the past <%= FixityReport::STALE_IN_DAYS %> days + Fully ingested, checked in the past <%= @stale_in_days %> days <%= number_with_delimiter(@fixity_report[:recent_checks]) %> - Fully ingested, stale checks (have not been checked for <%= FixityReport::STALE_IN_DAYS %> days, or ever) + Fully ingested, stale checks (have not been checked for <%= @stale_in_days %> days, or ever) <%= number_with_delimiter(@fixity_report[:no_checks_or_stale_checks]) %>