flickrchive 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87f970f83bff37b5efb482dab21f835967fc62b5
4
- data.tar.gz: 8f25abcb5892d0cd899adf292c649b430a71183f
3
+ metadata.gz: 533ec7bd851cf9e99a2dca4e086535a963195c23
4
+ data.tar.gz: d4c29dc59f9abdec1448f0d8afa140476f05def0
5
5
  SHA512:
6
- metadata.gz: 22b3fb93db85f95f9106afd4a25bd134dc2ae7e7a187141277fd3cec6dde2bc717b3e67d0f48877df5f804d7db70d19cd853c1388d4eb9dfc74f31222377102f
7
- data.tar.gz: 916010ff9c3376b1477f627ecbcb4d20e9f4be3457fe7bf071ac4eb66bf59efe683ded1a425bd28dfb16543c8decd6ea1a18de7eb82f94b3c3b4de9df1f45a84
6
+ metadata.gz: d6ec2f1eae28204be8e86111a11ec37ac17602d3504ea15f73380760e628f8b07a14e60d386d01d16f3ce22d09da338303fa6371c004c572a0bc1e5f3a453544
7
+ data.tar.gz: d42dbdc7bf0eb8195dfba1dc333c4b346850dbad350afc1b4f5088337fddf367cbc9b767346e3b695a0774aecb07a8c78be63196e61ed575141befb95b56140f
data/flickrchive.gemspec CHANGED
@@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
19
19
  spec.required_ruby_version = '>= 1.9.3'
20
20
  spec.required_rubygems_version = '>= 1.3.5'
21
21
  spec.summary = spec.description
22
- spec.version = '0.1.0'
22
+ spec.version = '0.1.2'
23
23
  end
@@ -21,6 +21,9 @@ module Flickrchive
21
21
  rescue FlickRaw::FailedResponse => e
22
22
  handle_flickr_fail(e)
23
23
  retry
24
+ rescue EOFError
25
+ Flickrchive.logger.info("Caught network EOFError. Retrying upload")
26
+ retry
24
27
  end
25
28
  Flickrchive.logger.info("Uploaded file: #{photo[:filename]}")
26
29
  photo[:flickr_id] = id
@@ -7,13 +7,18 @@ module Flickrchive
7
7
  def prepare
8
8
  fm = FileMagic.new
9
9
  Flickrchive.logger.info("Recursively inspecting directory for images, this may take awhile...")
10
+ self.db.synchronize do
11
+ @existing_files = self.db.map { |k,v| v[:filename]}
12
+ end
10
13
  files = FileList.new("#{self.directory}/**/*") do |fl|
11
14
  self.excludes.each do |exclude_matcher|
12
15
  fl.exclude(Regexp.new(exclude_matcher))
13
16
  end
14
17
  end
18
+ # get out list of files to attempt to process
19
+ to_do = files - @existing_files
15
20
 
16
- files.each do |fn|
21
+ to_do.each do |fn|
17
22
  new_photo = {filename: fn}
18
23
  begin
19
24
  new_photo[:type] = fm.file(fn)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickrchive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Nolen