vidispine 1.6.3 → 1.6.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
  SHA1:
3
- metadata.gz: cbc80a3dfc2e3cfe79c2ac9918df6770e9e6707b
4
- data.tar.gz: 0a711618f5cc6ffa79214c97995f020713ea473b
3
+ metadata.gz: 5fd19ae6c7308f20a78830b2fd0eb01894fc3fd1
4
+ data.tar.gz: 91e0f6c339c12f3c42df64f47c50cb9f3a5ce3bf
5
5
  SHA512:
6
- metadata.gz: 2295336eeb9f06fac7f52c49a7dc47d1e18d33d3e275707eb993b9df8ddfb31446e3e9edb0e404b0f3c55620d66d63ed1781eae5fc8cc35ee64edad7f6b379d2
7
- data.tar.gz: b5ee3f5fab269599c8e61b636b9ef326b9956fdaa2aadc034775c0a3120b884d3f5098f68a1680a5d4bc5b7ce54c2aaf01b68ca76f9fb25b16d15ee95ca3a53c
6
+ metadata.gz: 92dfee18a8d4097c7656768f7893313fbc6b68af8b03cdbc29343192663b492fc5a18c058daf3ddbcfca8908a6025d0d2ab4cdbec216b54a58945e2126520679
7
+ data.tar.gz: 170acf9adc3ba88657229b3c3b6ab568c466fa7f7feedce0301eb1291d80392d6a2afcb7f4d062870022eff1eb63aa35b9c3267099d007d334df3c7cbae96eb0
@@ -941,6 +941,24 @@ module Vidispine
941
941
  process_request_using_class(Requests::StorageFileGet, args, options)
942
942
  end
943
943
 
944
+ # @see http://apidoc.vidispine.com/latest/ref/storage/file.html#set-file-state
945
+ def storage_file_state_set(args = { }, options = { })
946
+ _request = Requests::BaseRequest.new(
947
+ args,
948
+ {
949
+ :http_path => 'storage/file/#{path_arguments[:file_id]}/state/#{path_arguments[:state]}',
950
+ :http_method => :put,
951
+ :default_parameter_send_in_value => :path,
952
+ :parameters => [
953
+ { :name => :file_id, :required => true },
954
+ { :name => :state, :required => true },
955
+ ]
956
+ }.merge(options)
957
+ )
958
+ process_request(_request, options)
959
+
960
+ end
961
+
944
962
  # @see http://apidoc.vidispine.com/4.2/ref/storage/file.html#list-files-in-storage
945
963
  def storage_files_get(args = { }, options = { })
946
964
  process_request_using_class(Requests::StorageFilesGet, args, options)
@@ -626,16 +626,21 @@ module Vidispine
626
626
 
627
627
  if file_id && file && !file['item']
628
628
  # If the passed file doesn't have an item then requery to verify that the item is absent
629
- storage_file_get_response = storage_file_get(:storage_id => storage_id, :file_id => file_id, :include_item => true)
629
+ storage_file_get_response = storage_file_get(:storage_id => storage_id,
630
+ :file_id => file_id, :include_item => true)
630
631
 
631
- raise "Error Getting Storage File. '#{storage_file_get_response.inspect}'" unless storage_file_get_response and storage_file_get_response['id']
632
+ unless storage_file_get_response and storage_file_get_response['id']
633
+ raise "Error Getting Storage File. '#{storage_file_get_response.inspect}'"
634
+ end
632
635
  _response[:storage_file_get_response] = storage_file_get_response
633
636
 
634
637
  file_found = true
635
638
 
636
639
  file = storage_file_get_response
637
640
  else
638
- storage_file_get_or_create_response = storage_file_get_or_create(storage_id, file_path_relative_to_storage_path, :extended_response => true)
641
+ storage_file_get_or_create_response = storage_file_get_or_create(storage_id,
642
+ file_path_relative_to_storage_path,
643
+ :extended_response => true)
639
644
  _response[:storage_file_get_or_create_response] = storage_file_get_or_create_response
640
645
  file = storage_file_get_or_create_response[:file]
641
646
  file_found = storage_file_get_or_create_response[:file_already_existed]
@@ -673,7 +678,10 @@ module Vidispine
673
678
  item_metadata_set(:item_id => item_id, :metadata_document => metadata_document)
674
679
  end
675
680
 
676
- should_add_to_collection = options.fetch(:add_item_to_collection, [ :collections, :collection, :collection_name, :collection_id, :file_path_collection_name_position ].any? { |v| args.keys.include?(v) })
681
+ should_add_to_collection = options.fetch(:add_item_to_collection,
682
+ [ :collections, :collection, :collection_name, :collection_id,
683
+ :file_path_collection_name_position
684
+ ].any? { |v| args.keys.include?(v) })
677
685
  if should_add_to_collection
678
686
  logger.debug { 'Determining Collection to Add the Item to.' }
679
687
  collections = determine_collection(args, options)
@@ -691,7 +699,9 @@ module Vidispine
691
699
  collection_object_add(:collection_id => collection_id, :object_id => item_id)
692
700
  end
693
701
 
694
- _response[:collection_object_add] = single_collection ? collection_object_add_responses.first : collection_object_add_responses
702
+ _response[:collection_object_add] = single_collection ?
703
+ collection_object_add_responses.first :
704
+ collection_object_add_responses
695
705
  end
696
706
 
697
707
  shape = item['shape']
@@ -1548,6 +1558,9 @@ module Vidispine
1548
1558
  storage_file_get_response = file = storage_file_get(:storage_id => storage_id, :file_id => _message['fileId'], :include_item => include_item)
1549
1559
  end
1550
1560
  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
1551
1564
  end
1552
1565
 
1553
1566
  logger.debug { "Method: #{__method__} Response: #{file.inspect}" }
@@ -1,3 +1,3 @@
1
1
  module Vidispine
2
- VERSION = '1.6.3'
2
+ VERSION = '1.6.4'
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.3
4
+ version: 1.6.4
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-11 00:00:00.000000000 Z
11
+ date: 2019-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler