Accept SHA256 as identifier for API playlists/show

This commit is contained in:
Thibault Jouan
2015-05-05 02:27:29 +00:00
parent 3089462d97
commit fedf565389
2 changed files with 12 additions and 2 deletions

View File

@@ -12,7 +12,10 @@ module API
private
def set_sound
@sound = Sound.find(params[:id])
@sound = case params[:id]
when /\A\d+\z/ then Sound.find(params[:id])
when /\A\h+\z/ then Sound.find_by_sha256!(params[:id])
end
end
end
end