lib/dvdprofiler2xbmc/collection.rb in royw-dvdprofiler2xbmc-0.0.3 vs lib/dvdprofiler2xbmc/collection.rb in royw-dvdprofiler2xbmc-0.0.4
- old
+ new
@@ -40,11 +40,11 @@
@filespec = filename
reload
save
end
- # save as a collection.yaml file unless the existing
+ # save as a collection.yaml file unless the existing
# collection.yaml is newer than the collection.xml
def save
unless @filespec.nil?
yaml_filespec = @filespec.ext('.yaml')
if !File.exist?(yaml_filespec) || (File.mtime(@filespec) > File.mtime(yaml_filespec))
@@ -63,11 +63,11 @@
else
AppConfig[:logger].error { "can not save, the filespec is nil" }
end
end
- # load the collection from the collection.yaml if it exists,
+ # load the collection from the collection.yaml if it exists,
# otherwise from the collection.xml
def reload
@title_isbn_hash.clear
@isbn_dvd_hash.clear
@isbn_title_hash.clear
@@ -100,14 +100,14 @@
dvd_hash[:actors] = dvd[:actors].compact.collect {|a| a[:actor]}.flatten.compact.collect do |a|
name = []
name << a['FirstName'] unless a['FirstName'].blank?
name << a['MiddleName'] unless a['MiddleName'].blank?
name << a['LastName'] unless a['LastName'].blank?
- info = {}
- info['name'] = name.join(' ')
- info['role'] = a['Role']
- info
+ info = {}
+ info['name'] = name.join(' ')
+ info['role'] = a['Role']
+ info
end
end
dvd_hash[:genres] = dvd[:genres].collect{|a| a[:genre]}.flatten unless dvd[:genres].blank?
dvd_hash[:studios] = dvd[:studios].collect{|a| a[:studio]}.flatten unless dvd[:studios].blank?
dvd_hash[:productionyear] = [dvd[:productionyear].join(',')] unless dvd[:productionyear].blank?
@@ -146,10 +146,10 @@
title = nil
unless src_title.nil?
title = src_title.dup
title.downcase!
TITLE_REPLACEMENTS.each do |replacement|
- replacement.each do |regex, value|
+ replacement.each do |regex, value|
title.gsub!(regex, value)
end
end
title.strip!
end