Sha256: 3d01066a01f3e221bf6bf2a2daab2c2bc861b151b5d49788b103fc7df8485904
Contents?: true
Size: 993 Bytes
Versions: 2
Compression:
Stored size: 993 Bytes
Contents
class TmdbInfo protected def initialize(profile) @profile = profile end public # == Synopsis # load data from themovieDb.com # see TmdbProfile.all for options def self.find(options) tmdb_info = nil profile = TmdbProfile.first(options) unless profile.nil? tmdb_info = TmdbInfo.new(profile) end tmdb_info end private # == Synopsis # map the tmdb.movie hash into the info hash TMDB_HASH_TO_INFO_MAP = { # urls # scores # idents # titles # imdb_ids # alternative_titles # posters # types # fanarts 'short_overviews' => 'plot', 'releases' => 'year' } public # == Synopsis # map the tmdb.movie hash into the info hash def to_xbmc_info info = Hash.new unless @profile.movie.blank? TMDB_HASH_TO_INFO_MAP.each do |key, value| info[value] = @profile.movie[key].first unless @profile.movie[key].blank? end end info end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
royw-dvdprofiler2xbmc-0.1.4 | lib/dvdprofiler2xbmc/models/tmdb_info.rb |
royw-dvdprofiler2xbmc-0.1.5 | lib/dvdprofiler2xbmc/models/tmdb_info.rb |