Accept SHA256 as identifier for API playlists/show
This commit is contained in:
1 parent
3089462d97
commit
fedf565389
2 files changed
+12
-2
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user