photein 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34b792399097ed2bb6a0339633d5e99c9a10387a98dcbd8e690f5442fbec4f93
4
- data.tar.gz: 395dae72589abe9809d1fada0868f28fea3ad26ec5d2260701c92d923bd8119c
3
+ metadata.gz: 4c649546f68f5f0547d94bc0dace264051b1b1fd4f37620e7a769939bc6330cd
4
+ data.tar.gz: 0e57a9fff26bf6aab6a49676cea4cf3213626693013ce80e4a9d616051e96091
5
5
  SHA512:
6
- metadata.gz: a25e497f9076b2d507f01004a790022fe0fcb1511ef9bf1b43bccf6ac1e718dda8f4e047131f3fb3c0f5865f16f51d59ff5616936200fd0ef9a3c2c6ed250fd2
7
- data.tar.gz: 61982abacad9467d9346799c8f2eb2839cdc5937805f5dd5c85f4edca2d56167418cc399f367e3ec5a11952fc44051bfb20ebfac9f4d60298727ec1c009b9929
6
+ metadata.gz: '072889b598976c14a89994fe61ecd24c47f73d34e3f8c090df002ddb92684ca145285bf7b891e98023f0947ed04e602b0335dc0504dcddfe8dba1b7689d1911d'
7
+ data.tar.gz: e355d41fe3ce4c9bf86ac243524abecac43f595df2eb67f43344098a0e3348edad55ab43af6746efd421021c53706aed0f0b76b1cfe63dfcefb8cdc69ad53174
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}-\d{2}-\d{6}( \(\d+\))?$/ # Signal: datetime + optional counter (at receipt)
89
- Time.strptime(filename[0, 24], 'signal-%F-%H%M%S')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Photein
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
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
- .join("*{#{media_type::SUPPORTED_FORMATS.join(',')}}")
17
- .then { |glob| Dir.glob(glob, File::FNM_CASEFOLD).sort }
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.3
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: 2021-12-11 00:00:00.000000000 Z
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.2.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: []