Skip to content

Commit

Permalink
Lang - ensure sample loader finds mp3 files too
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Jan 14, 2025
1 parent a3bdf9b commit a7f8965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/server/ruby/lib/sonicpi/sample_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def ls_samples(path, recursive=false)
@folder_contents_mutex.synchronize do
res = @cached_folder_contents[path]
return res if res
# match wav, aiff, aif, wave, flac, ogg and oga files
pattern = '*.{[wW][aA][vV],[wW][aA][vV][eE],[aA][iI][fF],[aA][iI][fF][fF],[fF][lL][aA][cC],[oO][gG][gGaA]}'
# match wav, aiff, aif, wave, flac, mp3, ogg and oga files
pattern = '*.{[wW][aA][vV],[wW][aA][vV][eE],[aA][iI][fF],[aA][iI][fF][fF],[fF][lL][aA][cC],[mM][pP]3},[oO][gG][gGaA]'
if recursive
res = Dir.chdir(path) { Dir.glob("**/#{pattern}").map { |p| File.expand_path(p) } }.sort
else
Expand Down

0 comments on commit a7f8965

Please sign in to comment.