Skip to content

Commit

Permalink
Merge pull request #6010 from avalonmediasystem/mf_reflections
Browse files Browse the repository at this point in the history
Reduce number of solr calls by preemptively loading reflections
  • Loading branch information
masaball authored Sep 4, 2024
2 parents b9c119f + b53e78a commit cb86a47
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ gem 'rack-cors', require: 'rack/cors'
gem 'rails_same_site_cookie'
gem 'recaptcha', require: 'recaptcha/rails'
gem 'samvera-persona', git: 'https://github.com/samvera-labs/samvera-persona.git', branch: 'rails_7-2'
gem 'speedy-af', '~> 0.3'
gem 'speedy-af', git: 'https://github.com/samvera-labs/speedy_af.git', branch: 'empty_reflection'

# Avalon Components
gem 'avalon-workflow', git: "https://github.com/avalonmediasystem/avalon-workflow.git", tag: 'avalon-r6.5'
Expand Down
15 changes: 10 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ GIT

GIT
remote: https://github.com/samvera-labs/samvera-persona.git
revision: 879fed8e7a3a86fb28eb1dba46bcf926a18dd330
revision: ce6ada95684fe1c5487e8ee5d698b8529c69bf75
branch: rails_7-2
specs:
samvera-persona (0.4.1)
Expand All @@ -78,6 +78,14 @@ GIT
paranoia (~> 3.0)
pretender

GIT
remote: https://github.com/samvera-labs/speedy_af.git
revision: 223abe9e2a7cdc68b033398bf69922523aeff47e
branch: empty_reflection
specs:
speedy-af (0.3.0)
activesupport (> 5.2)

GIT
remote: https://github.com/samvera/active_fedora.git
revision: a0b1725328a624b3106a04dacbf524275b06dd7a
Expand Down Expand Up @@ -931,9 +939,6 @@ GEM
nokogiri
stomp
xml-simple
speedy-af (0.3.0)
active-fedora (>= 11.0.0)
activesupport (> 5.2)
sprockets (3.7.3)
base64
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -1137,7 +1142,7 @@ DEPENDENCIES
sidekiq-cron (~> 1.9)
simplecov
solr_wrapper (>= 0.16)
speedy-af (~> 0.3)
speedy-af!
sprockets (~> 3.7.2)
sprockets-es6
sqlite3
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/master_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ def set_masterfile
end

def set_masterfile_proxy
if params[:id].blank? || SpeedyAF::Proxy::MasterFile.find(params[:id]).nil?
@master_file = SpeedyAF::Proxy::MasterFile.find(params[:id], load_reflections: true)
if params[:id].blank? || @master_file.nil?
flash[:notice] = "MasterFile #{params[:id]} does not exist"
end
@master_file = SpeedyAF::Proxy::MasterFile.find(params[:id])
end

# return deflated waveform content. deflate only if necessary
Expand Down

0 comments on commit cb86a47

Please sign in to comment.