myimdb 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/myimdb-catalogue +20 -20
  3. data/myimdb.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.10
1
+ 0.3.11
data/bin/myimdb-catalogue CHANGED
@@ -99,17 +99,21 @@ end
99
99
  # helper methods - end
100
100
 
101
101
  def repair_permissions_for(target_dir)
102
- conf_file_path = File.join(target_dir, conf_file_name)
103
- File.delete(conf_file_path) if File.exists?(conf_file_path)
102
+ if Platform.windows?
103
+ conf_file_path = File.join(target_dir, conf_file_name)
104
+ File.delete(conf_file_path) if File.exists?(conf_file_path)
104
105
 
105
- File.open(conf_file_path, 'wb') do |conf|
106
- conf.puts "[.ShellClassInfo]"
107
- conf.puts "IconResource=movie.ico,0"
108
- end
106
+ File.open(conf_file_path, 'wb') do |conf|
107
+ conf.puts "[.ShellClassInfo]"
108
+ conf.puts "IconResource=movie.ico,0"
109
+ end
109
110
 
110
- `attrib -s +h "#{conf_file_path}"`
111
- `attrib -r "#{target_dir}"`
112
- `attrib +r "#{target_dir}"`
111
+ `attrib -s +h "#{conf_file_path}"`
112
+ `attrib -r "#{target_dir}"`
113
+ `attrib +r "#{target_dir}"`
114
+ else
115
+ p 'Skipping permission repair; Windows required for this command'
116
+ end
113
117
  end
114
118
 
115
119
  def convert_to_icon(image_file_path, icon_file_path)
@@ -130,10 +134,6 @@ def save_image(target_dir, name, image_index=0)
130
134
 
131
135
  convert_to_icon(image_file_path, File.join(target_dir, icon_file_name))
132
136
 
133
- if Platform.windows?
134
- repair_permissions_for(target_dir)
135
- end
136
-
137
137
  File.delete(image_file_path) if File.exists?(image_file_path)
138
138
  end
139
139
  end
@@ -151,7 +151,6 @@ def generate_metadata(path, name)
151
151
  new_path
152
152
  end
153
153
 
154
-
155
154
  image_retry_limit = 2
156
155
 
157
156
  file_paths.each do |path|
@@ -170,10 +169,11 @@ file_paths.each do |path|
170
169
  elsif options[:metadata]
171
170
  p "Fetching metadata for: #{name}"
172
171
  path = generate_metadata(path, filtered_movie_name(name))
172
+ metadata_present = true
173
173
  end
174
174
 
175
175
  # movie icon exists and -f isn't supplied
176
- if !metadata_present
176
+ if !metadata_present and options[:images]
177
177
  p "Skipping: Metadata not present: #{name}"
178
178
  elsif File.exists?(File.join(path, 'movie.ico')) and !options[:force] and options[:images]
179
179
  p "Skipping: Image already exists for: #{name}"
@@ -187,11 +187,6 @@ file_paths.each do |path|
187
187
  end
188
188
  end
189
189
 
190
- if options[:'rebuild-permissions']
191
- p "Repairing permissions for: #{name}"
192
- repair_permissions_for(path)
193
- end
194
-
195
190
  if options[:'apply-icon']
196
191
  source_file = Dir.entries(path).find{ |file| file =~ /\.jpg|\.png/ }
197
192
  if source_file
@@ -201,6 +196,11 @@ file_paths.each do |path|
201
196
  p "Source image file not found for: #{name}"
202
197
  end
203
198
  end
199
+
200
+ if options[:'rebuild-permissions'] or options[:'apply-icon'] or (options[:images] and metadata_present)
201
+ p "Repairing permissions for: #{name}"
202
+ repair_permissions_for(path)
203
+ end
204
204
  rescue
205
205
  p "Unable to fetch details for: #{name}"
206
206
  end
data/myimdb.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{myimdb}
8
- s.version = "0.3.10"
8
+ s.version = "0.3.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gaurav"]
12
- s.date = %q{2010-01-22}
12
+ s.date = %q{2010-01-29}
13
13
  s.email = %q{gaurav@vinsol.com}
14
14
  s.executables = ["myimdb", "myimdb-catalogue"]
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myimdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaurav
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-22 00:00:00 +05:30
12
+ date: 2010-01-29 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency