Class: ThumbnailController
- Inherits:
-
Object
- Object
- ThumbnailController
- Defined in:
- lib/dvdprofiler2xbmc/controllers/thumbnail_controller.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(media) ⇒ ThumbnailController
constructor
A new instance of ThumbnailController.
-
#update ⇒ Object
update the movie’s thumbnail (.tbn) image.
Constructor Details
#initialize(media) ⇒ ThumbnailController
Returns a new instance of ThumbnailController.
15 16 17 |
# File 'lib/dvdprofiler2xbmc/controllers/thumbnail_controller.rb', line 15 def initialize(media) @media = media end |
Class Method Details
.update(media) ⇒ Object
11 12 13 |
# File 'lib/dvdprofiler2xbmc/controllers/thumbnail_controller.rb', line 11 def self.update(media) ThumbnailController.new(media).update end |
Instance Method Details
#update ⇒ Object
update the movie’s thumbnail (.tbn) image
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dvdprofiler2xbmc/controllers/thumbnail_controller.rb', line 20 def update result = false if @media.isbn.blank? unless @media.imdb_id.blank? if @media.image_files.empty? fetch_imdb_thumbnail(@media.imdb_id) result = true end end else copy_thumbnail(@media.isbn) result = true end result end |