active_encode 2.0.1 → 2.0.2

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
  SHA256:
3
- metadata.gz: 58c30e7dcd8eda848020f34fddcdb2d33d5d54a9bee8046e8667e952efd06831
4
- data.tar.gz: 065c13da7d8e5fca525bab0f871287f93eeee9a8f85d6a67a65f19e9fdf0affc
3
+ metadata.gz: 8e79b7e04c4ce64bd75701672631d45b7c7c7a340361295bfc007be2f28aa293
4
+ data.tar.gz: e5cd432ef6102257eff4d257906961ed1513e81f58520bdc6c6d4f07293d5a5a
5
5
  SHA512:
6
- metadata.gz: '009412b796a5b173dc6fcdd3b9db86c84eea369ceed5b28c3960fbd656572098f0c5c35462381b683f9c2565e8cc5211eaa788b2db2d3595d05ee1c0361dc40c'
7
- data.tar.gz: 9f906717cc1b97bcd6b85acd4bdf303c9d740fbad908fbb81c108a2f76608701e527b42a71cdd8fd19026a94e36033c879181c86dfee1beffc1c964ae59b0450
6
+ metadata.gz: 7126ae7b947b53233cd05f2202fb155a327144e8f611c81640b90611c0c600358e66374908820e7f6df35cb4d0837f8e2487d883b6151b9c3009526e330c7cc5
7
+ data.tar.gz: 73369f2a8423a4bcc5d346af76f7da2d8c3ca290da5f229218c137fdeb6e6155e1a4db4ade5e947bf78e3a3ef8cc8b35e2941b53767a52d3ecaac8e35211619d
data/.circleci/config.yml CHANGED
@@ -17,6 +17,7 @@ jobs:
17
17
  executor:
18
18
  name: 'samvera/ruby'
19
19
  ruby_version: << parameters.ruby_version >>
20
+ resource_class: large
20
21
  environment:
21
22
  ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-coffee --skip-puma --skip-test
22
23
  RAILS_VERSION: << parameters.rails_version >>
@@ -37,12 +38,13 @@ jobs:
37
38
  keys:
38
39
  - v1-ffmpeg-<< parameters.ffmpeg_version >>
39
40
 
40
- - run: curl https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-<< parameters.ffmpeg_version >>-amd64-static.tar.xz | tar xJ -C /tmp/ --strip-components=1
41
+ - run: if [ ! -f /tmp/ffmpeg ]; then curl https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-<< parameters.ffmpeg_version >>-amd64-static.tar.xz | tar xJ -C /tmp/ --strip-components=1; fi
41
42
 
42
43
  - save_cache:
43
44
  key: v1-ffmpeg-<< parameters.ffmpeg_version >>`
44
45
  paths:
45
46
  - /tmp/ffmpeg
47
+ - /tmp/ffprobe
46
48
 
47
49
  - samvera/cached_checkout
48
50
 
@@ -519,6 +519,8 @@ module ActiveEncode
519
519
  # NOTE: certain audio files don't return any track information
520
520
  @probe_cache ||= {}
521
521
  @probe_cache[url] ||= mediaconvert.probe({ input_files: [{ file_url: url }] })&.probe_results&.first
522
+ rescue Aws::MediaConvert::Errors::ServiceError
523
+ nil
522
524
  end
523
525
 
524
526
  def output_id_format
@@ -74,7 +74,7 @@ module ActiveEncode
74
74
 
75
75
  # Copy derivatives to work directory
76
76
  options[:outputs].each do |opt|
77
- output_path = copy_derivative_to_working_path(opt[:url], new_encode.id)
77
+ output_path = copy_derivative_to_working_path(opt[:url], opt[:label], new_encode.id)
78
78
  filename_label_hash[output_path] = opt[:label]
79
79
  end
80
80
 
@@ -286,8 +286,9 @@ module ActiveEncode
286
286
  ActiveEncode.sanitize_input(input_url)
287
287
  end
288
288
 
289
- def copy_derivative_to_working_path(url, id)
290
- output_path = working_path("outputs/#{ActiveEncode.sanitize_base url}#{File.extname url}", id)
289
+ def copy_derivative_to_working_path(url, label, id)
290
+ label_url = add_label_to_url(ActiveEncode.sanitize_base(url), label)
291
+ output_path = working_path("outputs/#{label_url}#{File.extname url}", id)
291
292
  if url.start_with? "s3://"
292
293
  # Use aws-sdk-s3 download_file method
293
294
  # Single request mode needed for compatibility with minio
@@ -297,6 +298,12 @@ module ActiveEncode
297
298
  end
298
299
  output_path
299
300
  end
301
+
302
+ def add_label_to_url(url, label)
303
+ return url if url.match?(/\-#{label}$/)
304
+
305
+ url.gsub(/#{label}$/, '') + "-#{label}"
306
+ end
300
307
  end
301
308
  end
302
309
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveEncode
3
- VERSION = '2.0.1'
3
+ VERSION = '2.0.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_encode
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein, Chris Colvard, Phuong Dinh