Skip to content

Commit

Permalink
Using quota usage instead of accumulator size on the project contents…
Browse files Browse the repository at this point in the history
… page (#765)
  • Loading branch information
JaymeeH authored Jun 12, 2024
1 parent 6a23610 commit 7528273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/models/mediaflux/http/asset_metadata_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def metadata
metadata[:total_file_count] = asset.xpath("./collection/accumulator/value/non-collections").text
metadata[:size] = asset.xpath("./collection/accumulator/value/total/@h").text
metadata[:quota_allocation] = asset.xpath("./collection/quota/allocation/@h").text
metadata[:quota_used] = asset.xpath("./collection/quota/used/@h").text
metadata[:ctime] = asset.xpath("./ctime")

end
Expand Down
7 changes: 4 additions & 3 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ def storage_usage(session_id:)
return unless in_mediaflux?

values = mediaflux_metadata(session_id:)
value = values.fetch(:size, 0)
#value = values.fetch(:size, 0)
quota_value = values.fetch(:quota_used, '')

if value.blank?
if quota_value.blank?
return self.class.default_storage_usage
else
return value
return quota_value
end
end

Expand Down

0 comments on commit 7528273

Please sign in to comment.