vidispine 1.6.4 → 1.6.5

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
  SHA1:
3
- metadata.gz: 5fd19ae6c7308f20a78830b2fd0eb01894fc3fd1
4
- data.tar.gz: 91e0f6c339c12f3c42df64f47c50cb9f3a5ce3bf
3
+ metadata.gz: f0cbef97ea08620518d549c8e63535b4f874f837
4
+ data.tar.gz: c9390762b54cb983df4162a76db719d2292a28a2
5
5
  SHA512:
6
- metadata.gz: 92dfee18a8d4097c7656768f7893313fbc6b68af8b03cdbc29343192663b492fc5a18c058daf3ddbcfca8908a6025d0d2ab4cdbec216b54a58945e2126520679
7
- data.tar.gz: 170acf9adc3ba88657229b3c3b6ab568c466fa7f7feedce0301eb1291d80392d6a2afcb7f4d062870022eff1eb63aa35b9c3267099d007d334df3c7cbae96eb0
6
+ metadata.gz: 0700cdddca6b418fdf8625782f6a1101bd2f3dd7f3a32f96dda9202355862ccdc236ecff8a7a1ef24c58853446a23691c8a78227ee1311aff0c96d509825c4d5
7
+ data.tar.gz: f1315859eeab23b15169e13b02887150323c2a29b2f1637a337a98ab9ab2a7a7be18ccf55243e07ba592ee8771cf6e17c053be210e5d0d8a2cae652e6f90cadd
@@ -355,7 +355,7 @@ module Vidispine
355
355
  _request = Requests::BaseRequest.new(
356
356
  args,
357
357
  {
358
- :http_path => '/item/#{item_id}/field-group',
358
+ :http_path => '/item/#{path_arguments[:item_id]}/field-group',
359
359
  :http_method => :get,
360
360
  :parameters => [
361
361
  { :name => :item_id, :send_in => :path, :required => true },
@@ -371,7 +371,7 @@ module Vidispine
371
371
  _request = Requests::BaseRequest.new(
372
372
  args,
373
373
  {
374
- :http_path => '/item/#{item_id}/field-group/#{field_group}',
374
+ :http_path => '/item/#{path_arguments[:item_id]}/field-group/#{path_arguments[:field_group]}',
375
375
  :http_method => :put,
376
376
  :default_parameter_send_in_value => :path,
377
377
  :parameters => [
@@ -880,7 +880,7 @@ module Vidispine
880
880
  :notification,
881
881
  :notificationData,
882
882
  :priority,
883
- :jobmetadata
883
+ :jobmetadata,
884
884
  ]
885
885
  }.merge(options)
886
886
  )
@@ -900,13 +900,13 @@ module Vidispine
900
900
  {
901
901
  :http_path => 'storage/#{path_arguments[:storage_id]}/file',
902
902
  :http_method => :post,
903
+ :default_parameter_send_in_value => :body,
903
904
  :parameters => [
904
905
  { :name => :storage_id, :send_in => :path, :required => true },
905
-
906
- :createOnly,
906
+ { :name => :createOnly, :send_in => :query },
907
+ :path,
907
908
  :state,
908
-
909
- { :name => :path, :send_in => :body }
909
+ :uri,
910
910
  ]
911
911
  }.merge(options)
912
912
  )
@@ -956,7 +956,6 @@ module Vidispine
956
956
  }.merge(options)
957
957
  )
958
958
  process_request(_request, options)
959
-
960
959
  end
961
960
 
962
961
  # @see http://apidoc.vidispine.com/4.2/ref/storage/file.html#list-files-in-storage
@@ -143,7 +143,6 @@ module Vidispine
143
143
  def response_parsed
144
144
  @response_parsed ||= begin
145
145
  response_body = response.respond_to?(:body) ? response.body : ''
146
- logger.debug { "Parsing Response. #{response_body.inspect}" }
147
146
 
148
147
  case response.content_type
149
148
  when 'application/json'
@@ -151,6 +150,9 @@ module Vidispine
151
150
  else
152
151
  response_body
153
152
  end
153
+ rescue => e
154
+ logger.debug { "Error Parsing Response. #{e.message}\n#{response_body.inspect}" }
155
+ raise
154
156
  end
155
157
  end
156
158
 
@@ -216,9 +218,13 @@ module Vidispine
216
218
  _request = klass.new(@uri.request_uri, _headers)
217
219
 
218
220
  if _request.request_body_permitted?
219
- _body = (body and !body.is_a?(String)) ? JSON.generate(body) : body
220
- logger.debug { "Processing Body: '#{_body}'" }
221
- _request.body = _body if _body
221
+ begin
222
+ _body = (body and !body.is_a?(String)) ? JSON.generate(body) : body
223
+ _request.body = _body if _body
224
+ rescue => e
225
+ logger.error { "Exception Processing Request Body: #{e.message}\n#{_body}"}
226
+ raise
227
+ end
222
228
  end
223
229
 
224
230
  _request
@@ -519,6 +519,10 @@ module Vidispine
519
519
 
520
520
  # collections = ( (collections_get || { })['collection'] || [ ] )
521
521
 
522
+ comparison_method, comparison_value = options.fetch(:case_sensitive, true) ? [ :eql?, true ] : [ :casecmp, 0 ]
523
+ collections_search_method = return_first_match ? :find : :select
524
+
525
+ collection = nil
522
526
  first = 1
523
527
  limit = 1000
524
528
  collections = [ ]
@@ -526,13 +530,16 @@ module Vidispine
526
530
  r = collections_get(:first => first, :number => limit)
527
531
  _collections = r['collection']
528
532
  break if _collections.empty?
533
+
534
+ if return_first_match
535
+ collection = _collections.send(collections_search_method) { |c| c['name'].send(comparison_method, collection_name) == comparison_value }
536
+ break if collection
537
+ end
538
+
529
539
  collections.concat _collections
530
540
  first += _collections.length
531
541
  end
532
-
533
- comparison_method, comparison_value = options.fetch(:case_sensitive, true) ? [ :eql?, true ] : [ :casecmp, 0 ]
534
- collections_search_method = return_first_match ? :find : :select
535
- collections.send(collections_search_method) { |c| c['name'].send(comparison_method, collection_name) == comparison_value }
542
+ return_first_match ? collection : collections.send(collections_search_method) { |c| c['name'].send(comparison_method, collection_name) == comparison_value }
536
543
  end
537
544
 
538
545
  # Adds a file using the files path
@@ -1554,13 +1561,10 @@ module Vidispine
1554
1561
  if (file || { })['fileAlreadyExists']
1555
1562
  file_already_existed = true
1556
1563
  _message = file['fileAlreadyExists']
1557
- logger.warn { "Running Recreation of Existing File Work Around: #{_message}" }
1564
+ logger.warn { "Running Re-creation of Existing File Workaround: #{_message}" }
1558
1565
  storage_file_get_response = file = storage_file_get(:storage_id => storage_id, :file_id => _message['fileId'], :include_item => include_item)
1559
1566
  end
1560
1567
  raise "Error Creating File on Storage. Response: #{response.inspect}" unless (file || { })['id']
1561
-
1562
- # Workaround: Ran into an issue with a v4.15 installation where setting file state on creation wasn't working
1563
- storage_file_state_set(:file_id => file['id'], :state => creation_state) if file['state'] != creation_state
1564
1568
  end
1565
1569
 
1566
1570
  logger.debug { "Method: #{__method__} Response: #{file.inspect}" }
@@ -1,3 +1,3 @@
1
1
  module Vidispine
2
- VERSION = '1.6.4'
2
+ VERSION = '1.6.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidispine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.4
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Whitson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-15 00:00:00.000000000 Z
11
+ date: 2019-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler