Replay fuori da Puma, fix ops cron e firma release Android.
Dopo auth Rails redirect a URL presigned su /media/ (edge → Garage); aumenta RAILS_MAX_THREADS, corregge ingest log ops via stdin e keystore Play Console. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
51
backend/spec/services/recordings/public_media_url_spec.rb
Normal file
51
backend/spec/services/recordings/public_media_url_spec.rb
Normal file
@@ -0,0 +1,51 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Recordings::PublicMediaUrl do
|
||||
before do
|
||||
allow(MatchLiveTv).to receive(:replay_storage_local?).and_return(false)
|
||||
allow(MatchLiveTv).to receive(:replay_media_redirect_enabled?).and_return(true)
|
||||
allow(MatchLiveTv).to receive(:replay_media_public_base_url).and_return("https://www.matchlivetv.it/media")
|
||||
allow(MatchLiveTv).to receive(:replay_presigned_url_ttl_seconds).and_return(7200)
|
||||
end
|
||||
|
||||
it "riscrive l'URL presigned Garage sul path pubblico /media/" do
|
||||
storage = instance_double(Recordings::Storage)
|
||||
allow(Recordings::Storage).to receive(:new).and_return(storage)
|
||||
allow(storage).to receive(:presigned_get_url).and_return(
|
||||
"http://garage:3900/matchlivetv-replays/teams/abc/video.mp4?X-Amz-Signature=abc"
|
||||
)
|
||||
|
||||
url = described_class.new(key: "teams/abc/video.mp4").call
|
||||
|
||||
expect(url).to eq(
|
||||
"https://www.matchlivetv.it/media/matchlivetv-replays/teams/abc/video.mp4?X-Amz-Signature=abc"
|
||||
)
|
||||
end
|
||||
|
||||
it "restituisce nil se il redirect è disabilitato" do
|
||||
allow(MatchLiveTv).to receive(:replay_media_redirect_enabled?).and_return(false)
|
||||
|
||||
expect(described_class.new(key: "teams/abc/video.mp4").call).to be_nil
|
||||
end
|
||||
|
||||
it "passa content-disposition per i download" do
|
||||
storage = instance_double(Recordings::Storage)
|
||||
allow(Recordings::Storage).to receive(:new).and_return(storage)
|
||||
allow(storage).to receive(:presigned_get_url).and_return("http://garage:3900/bucket/key.mp4?sig=1")
|
||||
|
||||
described_class.new(
|
||||
key: "key.mp4",
|
||||
disposition: "attachment",
|
||||
filename: "partita.mp4"
|
||||
).call
|
||||
|
||||
expect(storage).to have_received(:presigned_get_url).with(
|
||||
hash_including(
|
||||
key: "key.mp4",
|
||||
response_content_disposition: %(attachment; filename="partita.mp4")
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user