Created
November 15, 2012 08:18
-
-
Save valachi/4077361 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
v.errors[:file].present?