lib/dvdprofiler2xbmc/models/dvdprofiler_info.rb in royw-dvdprofiler2xbmc-0.1.2 vs lib/dvdprofiler2xbmc/models/dvdprofiler_info.rb in royw-dvdprofiler2xbmc-0.1.4

- old
+ new

@@ -1,11 +1,15 @@ class DvdprofilerInfo + protected + def initialize(profile) @profile = profile end + public + # == Synopsis # see DvdprofilerProfile.all for options # really should include at least: :title, :year, :isbn, :filespec def self.find(options) dvdprofiler_info = nil @@ -99,14 +103,14 @@ AppConfig[:logger].debug { "parent titles => #{titles.pretty_inspect}" } unless titles.empty? titles end def production_years - @profile.dvd_hash[:productionyear] rescue [] + @profile.dvd_hash[:productionyear].collect{|y| y =~ /(\d{4})/ ? $1 : nil}.compact rescue [] end def released_years - @profile.dvd_hash[:released] rescue [] + @profile.dvd_hash[:released].collect{|y| y =~ /(\d{4})/ ? $1 : nil}.compact rescue [] end def original_titles titles = [] originaltitle = @profile.dvd_hash[:originaltitle]