Skip to content

Commit

Permalink
225: Use URI and CGI instead of addressable to parse trailer url
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevallano committed Nov 24, 2020
1 parent 6ca5600 commit c5297ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/movies_controller.rb
Expand Up @@ -88,7 +88,7 @@ def required_params
end

def youtube_id
uri = Addressable::URI.parse(params[:trailer])
uri.query_values['v'] if uri.query_values
uri = URI.parse(params[:trailer])
CGI::parse(uri.query)['v']&.first if uri.query
end
end

0 comments on commit c5297ed

Please sign in to comment.