flickrup 0.1.5 → 0.1.6
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.
- data/lib/flickrup/ext/tag_sets.rb +4 -0
- data/lib/flickrup/processor.rb +15 -9
- data/lib/flickrup/tagged_image.rb +1 -1
- metadata +3 -3
@@ -1,6 +1,9 @@
|
|
1
1
|
require "flickrup/ext/prefixed_extension"
|
2
|
+
require "flickrup/logging"
|
2
3
|
|
3
4
|
class TagSets < PrefixedExtension
|
5
|
+
include Logging
|
6
|
+
|
4
7
|
def initialize(config, delegate, context)
|
5
8
|
super(config)
|
6
9
|
@delegate = delegate
|
@@ -13,6 +16,7 @@ class TagSets < PrefixedExtension
|
|
13
16
|
uploaded = @delegate.upload(ctx)
|
14
17
|
|
15
18
|
sets.each do |set|
|
19
|
+
logger.debug("Adding #{ctx.image.filename} to set: #{set}")
|
16
20
|
@flickr.add_to_set(uploaded, set)
|
17
21
|
end
|
18
22
|
end
|
data/lib/flickrup/processor.rb
CHANGED
@@ -38,14 +38,18 @@ class Processor
|
|
38
38
|
logger.info("Would now upload & move #{tagged.length} files, pausing for 5 secs instead")
|
39
39
|
sleep 5
|
40
40
|
else
|
41
|
-
tagged.each
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
41
|
+
tagged.each do |x|
|
42
|
+
begin
|
43
|
+
logger.debug("Beginning upload for #{x.filename}...")
|
44
|
+
x.doUpload(get_preupload_handlers, uploader)
|
45
|
+
logger.debug("Upload complete for #{x.filename}")
|
46
|
+
logger.debug("Beginning archive for #{x.filename}...")
|
47
|
+
x.archive(@config[:archive_dir])
|
48
|
+
logger.debug("Processing complete for #{x.filename}")
|
49
|
+
rescue => e
|
50
|
+
logger.error("Failed to process #{x.filename} due to exception: #{e}")
|
51
|
+
end
|
52
|
+
end
|
49
53
|
end
|
50
54
|
|
51
55
|
logger.debug("Processed #{tagged.length} valid files")
|
@@ -70,7 +74,9 @@ class Processor
|
|
70
74
|
[MachineTags.new(@config, {}), ReplacementTags.new(@config)]
|
71
75
|
end
|
72
76
|
|
73
|
-
def upload_handlers()
|
77
|
+
def upload_handlers()
|
78
|
+
[TagSets, Visibility]
|
79
|
+
end
|
74
80
|
|
75
81
|
end
|
76
82
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickrup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan Gilbert
|