Permalink
Browse files

Fix saving out settings

  • Loading branch information...
1 parent 1400cf0 commit dcdfcc82190be8362a4cddc4ad0e400da3b9e910 @paulcbetts committed Nov 23, 2007
Showing with 14 additions and 7 deletions.
  1. +1 −0 lib/library.rb
  2. +1 −0 lib/main.rb
  3. +12 −0 lib/settings.rb
  4. +0 −7 lib/utility.rb
View
@@ -70,6 +70,7 @@ def load(files, progress_rate = 0.05)
yield_every = (files.size * progress_rate).to_i
files.each do |current|
count += 1
+ yield(count.to_f / files.size) if (block_given? and (count % yield_every) == 0)
#log DEBUG, 'Reading %s..' % current
# First, see if we've already scanned this file before (save some time
View
@@ -203,6 +203,7 @@ def run
results[:script])
# Save out the settings
+
log DEBUG, 'Exiting application'
end
View
@@ -53,3 +53,15 @@ def save(path)
File.open(path, "w") { |file| file.write(YAML::dump(self)) }
end
end
+
+def load_settings(library)
+ # Load our settings
+ # FIXME: I am retarded
+ @settings = EstelleSettings.load(Platform.settings_file_path) || EstelleSettings.new
+ Song.sub_table = @settings.tagsubst_table
+ library.is_soundtrack = @settings.soundtrack_table
+end
+
+def save_settings(library)
+ @settings.save(Platform.settings_file_path)
+end
View
@@ -122,10 +122,3 @@ def filelist_from_root(path)
list
end
-
-def load_settings(library)
- # Load our settings
- @settings = EstelleSettings.load(Platform.settings_file_path) || EstelleSettings.new
- Song.sub_table = @settings.tagsubst_table
- library.is_soundtrack = @settings.soundtrack_table
-end

0 comments on commit dcdfcc8

Please sign in to comment.