Class: FanartController

Inherits:
Object
  • Object
show all
Defined in:
lib/dvdprofiler2xbmc/controllers/fanart_controller.rb

Overview

Synopsis

Media encapsulates information about a single media file

Usage:

controller = FanartController.new(media)
controller.update

or

FanartController.update(media)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(media) ⇒ FanartController

Synopsis

media => Media instance


19
20
21
# File 'lib/dvdprofiler2xbmc/controllers/fanart_controller.rb', line 19

def initialize(media)
  @media = media
end

Class Method Details

.update(media) ⇒ Object

Synopsis

class access method


13
14
15
# File 'lib/dvdprofiler2xbmc/controllers/fanart_controller.rb', line 13

def self.update(media)
  FanartController.new(media).update
end

Instance Method Details

#updateObject

Synopsis

update the meta-data and thumbnails


25
26
27
28
29
30
31
32
33
34
# File 'lib/dvdprofiler2xbmc/controllers/fanart_controller.rb', line 25

def update
  result = true
  unless @media.imdb_id.blank?
    if @media.fanart_files.empty?
      fetch_fanart(@media.imdb_id)
      link_fanart(@media.path_to(:fanart))
    end
  end
  result
end