media_archiver 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b989a4e5cda660b386280c064560963b9a42603
4
- data.tar.gz: 58e679df4a7651ea2e6d936b2d1f5ddcb6bddc0e
3
+ metadata.gz: e7485f7c10e7c55a341846fa6ef7a047961fbdef
4
+ data.tar.gz: 828b4a471f13b64ed3e8999d727f7be37fcf341f
5
5
  SHA512:
6
- metadata.gz: 10d96ee3da9d9ab082108584e894db5e3da27a6a5f5892daf80aff85e4525463ed44e46f318746fd4a8e5bc44f4287de808f8f6a9e3be6380b11b80918162c2a
7
- data.tar.gz: fc8cb9ca9da4d1c99c7dde978aa7f53ada35ec32a2d88fad9dd681d9a95c65485759a13babe6e49e0b3aa439042710189afa28c31eddf5fe2cfe0ebf8200c1ca
6
+ metadata.gz: 406d5ed9b92d3d418b9f90c041c99f579b9b629f0bb3514de129f298fa558f8a56864973c109933b96a6d8f116042fe103aaec98a3f8d2e3670f9e451e22af41
7
+ data.tar.gz: c5f5844419634c8c71a35e53cd33c6439c40b767dd4e6d10943badd67fc04e0fdb1f2740e5d4a315834f56c3a1c65fe676e7ecb7848fd83d85c6dd9bbb94a0db
data/README.md CHANGED
@@ -50,9 +50,21 @@ Configurations are prioritized like:
50
50
  ---
51
51
  output_dir: ~/photos
52
52
  recursive: true
53
- output_template: :date_created/:make/:model
53
+ output_template: :DateTimeOriginal/:Make/:Model
54
54
  ```
55
55
 
56
+ ### `output_template`
57
+
58
+ Anything that starts with a colon the script will replace with the corresponding
59
+ EXIF tag (if set on the individual file), while anything thing else is taken
60
+ as-is and is placed directly on the output path.
61
+
62
+ Not all media files have the same EXIF tags and not all are commonly used. You
63
+ can check the [list of possible tags](http://owl.phy.queensu.ca/~phil/exiftool/TagNames/index.html)
64
+ and test around with your own files.
65
+
66
+ Also, any date/time values are currently transformed to a fixed date string.
67
+
56
68
  ## Contributing
57
69
 
58
70
  1. Fork it ( https://github.com/[my-github-username]/media_archiver/fork )
@@ -64,10 +64,14 @@ module MediaArchiver
64
64
  output = [output_path]
65
65
 
66
66
  output += output_template_parts(template).map do |key|
67
- value = file.exif_tags[key.to_s.downcase]
68
- value = value.to_date.to_s if value.is_a?(Time)
67
+ if key.is_a? Symbol
68
+ value = file.exif_tags[key.to_s.downcase]
69
+ value = value.to_date.to_s if value.is_a?(Time)
69
70
 
70
- value
71
+ value
72
+ else
73
+ key
74
+ end
71
75
  end
72
76
  output << file.file_name
73
77
 
@@ -1,3 +1,3 @@
1
1
  module MediaArchiver
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_archiver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ramalho