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 +4 -4
- data/README.md +13 -1
- data/lib/media_archiver/cli.rb +7 -3
- data/lib/media_archiver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7485f7c10e7c55a341846fa6ef7a047961fbdef
|
4
|
+
data.tar.gz: 828b4a471f13b64ed3e8999d727f7be37fcf341f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: :
|
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 )
|
data/lib/media_archiver/cli.rb
CHANGED
@@ -64,10 +64,14 @@ module MediaArchiver
|
|
64
64
|
output = [output_path]
|
65
65
|
|
66
66
|
output += output_template_parts(template).map do |key|
|
67
|
-
|
68
|
-
|
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
|
-
|
71
|
+
value
|
72
|
+
else
|
73
|
+
key
|
74
|
+
end
|
71
75
|
end
|
72
76
|
output << file.file_name
|
73
77
|
|