diff --git a/backend/app/controllers/sonolus/asset_controller.rb b/backend/app/controllers/sonolus/asset_controller.rb index 988688a..e852816 100644 --- a/backend/app/controllers/sonolus/asset_controller.rb +++ b/backend/app/controllers/sonolus/asset_controller.rb @@ -166,12 +166,13 @@ def self.asset_get(type, name) elsif v.start_with?("!file:") name, srl_type = v.delete_prefix("!file:").split("/") srl_type ||= name + hash = + Digest::SHA1.file( + Rails.root.join("assets", "#{type}s", name) + ).hexdigest v = { - hash: - Digest::SHA1.file( - Rails.root.join("assets", "#{type}s", name) - ).hexdigest, - url: "/sonolus/assets/#{type}s/#{name}", + hash:, + url: "/sonolus/assets/#{type}s/#{name}?hash=#{hash}", type: srl_type } end