photein 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/photein/config.rb +4 -4
- data/lib/photein/image.rb +2 -2
- data/lib/photein/media_file.rb +1 -1
- data/lib/photein/version.rb +1 -1
- data/lib/photein.rb +6 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c649546f68f5f0547d94bc0dace264051b1b1fd4f37620e7a769939bc6330cd
|
4
|
+
data.tar.gz: 0e57a9fff26bf6aab6a49676cea4cf3213626693013ce80e4a9d616051e96091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '072889b598976c14a89994fe61ecd24c47f73d34e3f8c090df002ddb92684ca145285bf7b891e98023f0947ed04e602b0335dc0504dcddfe8dba1b7689d1911d'
|
7
|
+
data.tar.gz: e355d41fe3ce4c9bf86ac243524abecac43f595df2eb67f43344098a0e3348edad55ab43af6746efd421021c53706aed0f0b76b1cfe63dfcefb8cdc69ad53174
|
data/lib/photein/config.rb
CHANGED
@@ -74,10 +74,10 @@ module Photein
|
|
74
74
|
|
75
75
|
def destinations
|
76
76
|
@destinations ||= {
|
77
|
-
master:
|
78
|
-
desktop:
|
79
|
-
web:
|
80
|
-
}.compact
|
77
|
+
master: @params[:'library-master'],
|
78
|
+
desktop: @params[:'library-desktop'],
|
79
|
+
web: @params[:'library-web']
|
80
|
+
}.compact.transform_values(&Pathname.method(:new))
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
data/lib/photein/image.rb
CHANGED
@@ -85,8 +85,8 @@ module Photein
|
|
85
85
|
Time.strptime(filename, 'IMG-%Y%m%d-WA%M%S')
|
86
86
|
when /^IMG_\d{8}_\d{6}_\d{3}$/ # Telegram: datetime in milliseconds (at download)
|
87
87
|
Time.strptime(filename, 'IMG_%Y%m%d_%H%M%S_%L')
|
88
|
-
when /^signal-\d{4}-\d{2}
|
89
|
-
Time.strptime(filename[0,
|
88
|
+
when /^signal-\d{4}(-\d{2}){5}[-\d]*$/ # Signal: datetime + optional counter (at receipt)
|
89
|
+
Time.strptime(filename[0, 26], 'signal-%F-%H-%M-%S')
|
90
90
|
when /^\d{13}$/ # LINE: UNIX time in milliseconds (at download)
|
91
91
|
Time.strptime(filename[0..-4], '%s')
|
92
92
|
else
|
data/lib/photein/media_file.rb
CHANGED
data/lib/photein/version.rb
CHANGED
data/lib/photein.rb
CHANGED
@@ -11,10 +11,13 @@ module Photein
|
|
11
11
|
class << self
|
12
12
|
def run
|
13
13
|
[Photein::Image, Photein::Video].each do |media_type|
|
14
|
+
# Why not use Dir.glob? It refuses to do case-insensitive matching on Linux
|
15
|
+
ftype_regex = /(#{media_type::SUPPORTED_FORMATS.join('|').gsub('.', '\.')})$/i
|
16
|
+
|
14
17
|
Pathname(Photein::Config.source)
|
15
|
-
.join(Photein::Config.recursive ? '**' : '')
|
16
|
-
.
|
17
|
-
.
|
18
|
+
.join(Photein::Config.recursive ? '**' : '', '*')
|
19
|
+
.then(&Dir.method(:glob)).sort
|
20
|
+
.select { |file| file.match?(ftype_regex) }
|
18
21
|
.map(&media_type.method(:new))
|
19
22
|
.each(&:import)
|
20
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: photein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Lue
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mediainfo
|
@@ -144,7 +144,7 @@ licenses:
|
|
144
144
|
- MIT
|
145
145
|
metadata:
|
146
146
|
source_code_uri: https://github.com/rlue/photein
|
147
|
-
post_install_message:
|
147
|
+
post_install_message:
|
148
148
|
rdoc_options: []
|
149
149
|
require_paths:
|
150
150
|
- lib
|
@@ -159,8 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.
|
163
|
-
signing_key:
|
162
|
+
rubygems_version: 3.3.7
|
163
|
+
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Import/rename photos & videos from one directory to another.
|
166
166
|
test_files: []
|