Skip to content

Commit

Permalink
Merge pull request #377 from blackcandy-org/alac-transcode
Browse files Browse the repository at this point in the history
Transcode ALAC format for non-safari browsers
  • Loading branch information
aidewoode authored May 8, 2024
2 parents d35775f + 6ed7ad5 commit ff8043d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ class ApplicationController < ActionController::Base
def need_transcode?(song)
song_format = song.format

return true unless song_format.in?(Stream::WEB_SUPPORTED_FORMATS)
return true if browser.safari? && !song_format.in?(Stream::SAFARI_SUPPORTED_FORMATS)
unless native_app?
return true if !browser.safari? && !song_format.in?(Stream::WEB_SUPPORTED_FORMATS)
# Non-Safari browsers don't support ALAC format. So we need to transcode it.
return true if !browser.safari? && song_format == "m4a" && song.lossless?
return true if browser.safari? && !song_format.in?(Stream::SAFARI_SUPPORTED_FORMATS)
end

return true if ios_app? && !song_format.in?(Stream::IOS_SUPPORTED_FORMATS)
return true if android_app? && !song_format.in?(Stream::ANDROID_SUPPORTED_FORMATS)

Expand Down

0 comments on commit ff8043d

Please sign in to comment.