photo-helper 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/helpers/smugmug_album.rb +7 -8
- data/lib/photo-helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 267cd7787b42ba92cc8a5cbb0b2fc3b6df7c89e9f9e329448d15ca2b0497f312
|
4
|
+
data.tar.gz: 50a2f2411eb195e74445652ce13e6bd3e5aaefc7b2e9a9fba8134cb0530d786d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b9af79a851d3be2e57a1c20189fd0e145a415f09046a95820b8c97cf6d9dc82d64dd6b6cba3effc9edd6bde73a05bab5fc1705e0f2dfaa74de0d93519a48b50
|
7
|
+
data.tar.gz: 626ca8ea86130530e073ec17f3144376e104b618edbff9c057f26203d15423899b7e8fa6d2721b0ea0f453f5f94df5c33e6a5f990562fa3ffaea5b06b961b904
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ class SmugmugAlbumHelper
|
|
8
8
|
attr_accessor :smugmug_api
|
9
9
|
|
10
10
|
PATH_REGEX = %r{^.+Pictures\/.+\/(\d{4})\/(\d{2})_.+\/[^_]+_([^\/]+)}
|
11
|
-
KEYWORD_WHITELITS = %w(instagram exported)
|
11
|
+
# KEYWORD_WHITELITS = %w(instagram exported)
|
12
12
|
|
13
13
|
def self.supported_folder?(search_path)
|
14
14
|
PATH_REGEX.match?(search_path)
|
@@ -37,7 +37,9 @@ class SmugmugAlbumHelper
|
|
37
37
|
def initialize(search_path, album = nil)
|
38
38
|
@search_extensions = IMAGE_EXTENSIONS.concat(["XMP"])
|
39
39
|
|
40
|
+
|
40
41
|
@search_path = Pathname.new(search_path)
|
42
|
+
|
41
43
|
@smugmug = SmugmugAPI.new
|
42
44
|
|
43
45
|
@album_name = album || album_name
|
@@ -52,6 +54,7 @@ class SmugmugAlbumHelper
|
|
52
54
|
|
53
55
|
def parse_path
|
54
56
|
if matches = "#{@search_path}/".to_s.match(PATH_REGEX)
|
57
|
+
@album_root = Pathname.new(matches[0])
|
55
58
|
@year = matches[1]
|
56
59
|
@month = Date::MONTHNAMES[matches[2].to_i].capitalize
|
57
60
|
@location = matches[3].split("_").map(&:capitalize).join(' ')
|
@@ -180,10 +183,6 @@ class SmugmugAlbumHelper
|
|
180
183
|
trash_album_name = File.join("trash/#{album_name}")
|
181
184
|
trash_album = @smugmug.get_or_create_album(trash_album_name)
|
182
185
|
@smugmug.move_images(to_delete.map{ |u| u[:uri] }, trash_album[:id])
|
183
|
-
# to_delete.each do |uploaded|
|
184
|
-
# puts uploaded[:filename]
|
185
|
-
# @smugmug.http(:delete, uploaded[:uri])
|
186
|
-
# end
|
187
186
|
end
|
188
187
|
end
|
189
188
|
|
@@ -284,9 +283,9 @@ class SmugmugAlbumHelper
|
|
284
283
|
end
|
285
284
|
|
286
285
|
def image_dir_keywords(image)
|
287
|
-
rel = Pathname.new(image).relative_path_from(@
|
288
|
-
#
|
289
|
-
rel
|
286
|
+
rel = Pathname.new(image).relative_path_from(@album_root).to_s.downcase.split("/")
|
287
|
+
# drop filename
|
288
|
+
rel.pop
|
290
289
|
return nil if rel.empty?
|
291
290
|
rel
|
292
291
|
end
|
data/lib/photo-helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: photo-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Caldwell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|