vidispine 1.6.3 → 1.6.4
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 +4 -4
- data/lib/vidispine/api/client.rb +18 -0
- data/lib/vidispine/api/utilities.rb +18 -5
- data/lib/vidispine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fd19ae6c7308f20a78830b2fd0eb01894fc3fd1
|
4
|
+
data.tar.gz: 91e0f6c339c12f3c42df64f47c50cb9f3a5ce3bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92dfee18a8d4097c7656768f7893313fbc6b68af8b03cdbc29343192663b492fc5a18c058daf3ddbcfca8908a6025d0d2ab4cdbec216b54a58945e2126520679
|
7
|
+
data.tar.gz: 170acf9adc3ba88657229b3c3b6ab568c466fa7f7feedce0301eb1291d80392d6a2afcb7f4d062870022eff1eb63aa35b9c3267099d007d334df3c7cbae96eb0
|
data/lib/vidispine/api/client.rb
CHANGED
@@ -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,
|
629
|
+
storage_file_get_response = storage_file_get(:storage_id => storage_id,
|
630
|
+
:file_id => file_id, :include_item => true)
|
630
631
|
|
631
|
-
|
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,
|
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,
|
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 ?
|
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}" }
|
data/lib/vidispine/version.rb
CHANGED
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
|
+
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
|
+
date: 2019-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|