cul_scv_hydra 0.18.1 → 0.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/generic_resource.rb +11 -10
- data/lib/cul_scv_hydra/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: 8a1f95f27c9815b98f9bbe434c0cbacfd8088596
|
4
|
+
data.tar.gz: 8fc95376596dcb379c2ee4d4bdb5699e3925932f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a7f2aeea4b0e7f64e60f741563ee968c3c1ea80a2a41ebcee43b8be4ec60f9c8eb52925993ab327157f9cf1cc8806117ff765b07e2cdd58ff7108434a83f8e
|
7
|
+
data.tar.gz: bb97ea65500960d7d6ff4ca4a5851b4733dc723cb82260da480e4a1b6208d7f7fe1ab88f293574809d8c7f57672f89da26db1a5a4353102a99c98de5909ba0e9
|
@@ -94,7 +94,8 @@ class GenericResource < ::ActiveFedora::Base
|
|
94
94
|
rels.each do |dsuri, props|
|
95
95
|
if dsuri =~ /\/content$/ or not props[FORMAT_OF_PREDICATE].blank?
|
96
96
|
dsid = dsuri.split('/')[-1]
|
97
|
-
|
97
|
+
puts props.inspect
|
98
|
+
res = datastream_as_resource(dsid, props.with_indifferent_access)
|
98
99
|
results << res
|
99
100
|
end
|
100
101
|
end
|
@@ -113,10 +114,10 @@ class GenericResource < ::ActiveFedora::Base
|
|
113
114
|
width_rel = rels_int.relationships(dsuri, :image_width)[0]
|
114
115
|
length_rel = rels_int.relationships(dsuri, :image_length)[0]
|
115
116
|
extent_rel = rels_int.relationships(dsuri, :extent)[0]
|
116
|
-
props = {
|
117
|
-
props[
|
118
|
-
props[
|
119
|
-
props[
|
117
|
+
props = {extent: [], image_width: [], image_length: []}
|
118
|
+
props[:extent] << extent_rel.object.to_s unless extent_rel.blank?
|
119
|
+
props[:image_width] << width_rel.object.to_s unless width_rel.blank?
|
120
|
+
props[:image_length] << length_rel.object.to_s unless length_rel.blank?
|
120
121
|
results << datastream_as_resource(dsid, props)
|
121
122
|
end
|
122
123
|
end
|
@@ -124,7 +125,7 @@ class GenericResource < ::ActiveFedora::Base
|
|
124
125
|
end
|
125
126
|
|
126
127
|
def zooming?
|
127
|
-
|
128
|
+
(zr = rels_int.relationships(datastreams['content'], :foaf_zooming) and not zr.first.blank?)
|
128
129
|
end
|
129
130
|
|
130
131
|
private
|
@@ -137,12 +138,12 @@ class GenericResource < ::ActiveFedora::Base
|
|
137
138
|
res[:mime_type] = ds.mimeType
|
138
139
|
res[:content_models] = ["Datastream"]
|
139
140
|
res[:file_size] = ds.dsSize.to_s
|
140
|
-
if res[:file_size] == "0" and props[
|
141
|
-
res[:file_size] = (props[
|
141
|
+
if res[:file_size] == "0" and props[:extent]
|
142
|
+
res[:file_size] = (props[:extent].first || "0")
|
142
143
|
end
|
143
144
|
res[:size] = (res[:file_size].to_i / 1024).to_s + " Kb"
|
144
|
-
res[:width] = props[
|
145
|
-
res[:height] = props[
|
145
|
+
res[:width] = (props[:image_width] and props[:image_width].first) || "0"
|
146
|
+
res[:height] = (props[:image_length] and props[:image_length].first) || "0"
|
146
147
|
res[:dimensions] = "#{res[:width]} x #{res[:height]}"
|
147
148
|
base_filename = pid.gsub(/\:/,"")
|
148
149
|
res[:filename] = base_filename + "." + dsid + "." + ds.mimeType.gsub(/^[^\/]+\//,"")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_scv_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|