Skip to content

Commit

Permalink
transform into larger poster
Browse files Browse the repository at this point in the history
  • Loading branch information
maddox committed Oct 10, 2009
1 parent 3d142ed commit 38cb50f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/trailers/movie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ class Movie

def initialize(options={})
@title = options["title"]
@poster_url = options["poster"]
@directors = options["directors"].split(', ') if options["directors"]
@genres = options["genre"]
@mpaa_rating = options["rating"]
@studio = options["studio"]
@actors = options["actors"]
@release_date = Date.parse(options["releasedate"]) if options["releasedate"]

# transform poster_url into the larger one
small_poster_url = options["poster"]
small_filename = small_poster_url.split('/').last
large_url = small_poster_url.gsub('trailers', 'moviesxml/s').gsub('/images/', '/posters/')
large_filename = small_filename.gsub(/_(\d+).jpg/, "_l" + '\1' + ".jpg")
@poster_url = large_url.gsub(small_filename, large_filename)

# do trailer
trailer_hash = options['trailers'][0]
# inject the url if its not already there, this happens on search results
Expand Down

0 comments on commit 38cb50f

Please sign in to comment.