File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def construct_download_path
4848 when :generic , :adobe
4949 url . gsub ( /(?:#{ Regexp . escape ( http_base ) } \/ )(?:audio-only\/ )?(.*)(?:\. m3u8)/ , '\1' )
5050 when :nginx
51- url . gsub ( /(?:#{ Regexp . escape ( Settings . streaming . http_base ) } \/ )(.*) (?:\/ index\. m3u8)/ , '\1' )
51+ url . gsub ( /(?:#{ Regexp . escape ( Settings . streaming . http_base ) } \/ )(.*(mp4|mp3)) (?:\/ index\. m3u8|$ )/ , '\1' )
5252 when :wowza
5353 # Wowza HLS urls include the extension between the base and relative path.
5454 # "http_base/extension:path/filename.extension/playlist.m3u8"
Original file line number Diff line number Diff line change 153153 allow ( Settings . streaming ) . to receive ( :server ) . and_return ( :nginx )
154154 expect ( subject . download_path ) . to eq "file://6f69c008-06a4-4bad-bb60-26297f0b4c06/35bddaa0-fbb4-404f-ab76-58f22921529c/warning.mp4"
155155 end
156+
157+ context "with mp3 derivative" do
158+ let ( :hls_url ) { "http://localhost:3000/streams/6f69c008-06a4-4bad-bb60-26297f0b4c06/35bddaa0-fbb4-404f-ab76-58f22921529c/warning.mp3" }
159+
160+ it "provides a file path" do
161+ allow ( Settings . streaming ) . to receive ( :server ) . and_return ( :nginx )
162+ expect ( subject . download_path ) . to eq "file://6f69c008-06a4-4bad-bb60-26297f0b4c06/35bddaa0-fbb4-404f-ab76-58f22921529c/warning.mp3"
163+ end
164+ end
156165 end
157166
158167 describe "s3" do
You can’t perform that action at this time.
0 commit comments