Skip to content

Instantly share code, notes, and snippets.

@valachi
Created November 15, 2012 08:18
Show Gist options
  • Select an option

  • Save valachi/4077361 to your computer and use it in GitHub Desktop.

Select an option

Save valachi/4077361 to your computer and use it in GitHub Desktop.
def save_info!
imdb_show ||= Imdb::TvShow.new(show.imdb_id)
if imdb_show && imdb_show.title.downcase == show.title.downcase && imdb_show.is_a_tvshow?
self.title = imdb_show.season(season).episode(number.to_i).title
self.airdate = imdb_show.season(season).episode(number.to_i).airdate
self.plot = imdb_show.season(season).episode(number.to_i).plot
else
self.info_status = 'Error with imdb_show'
end
begin
save!
rescue Exception => e
if video.errors.on(:video).present?
logger.info "Something"
video.destroy
else
self.info_status = e.message
end
end
@valachi
Copy link
Copy Markdown
Author

valachi commented Nov 15, 2012

v.errors[:file].present?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment