|
@@ -41,15 +41,17 @@ export default {
|
|
|
if (node.type === 'Creation') {
|
|
|
node.variant = [{ id: 0 }]
|
|
|
if (node.files && node.files.length) {
|
|
|
- const mime = node.files[0].filemime
|
|
|
+ const creationFile = node.files.shift()
|
|
|
+ if (!node.files.length) node.files = null
|
|
|
+ const mime = creationFile.filemime
|
|
|
if (mime === 'application/pdf') {
|
|
|
- node.iframeUrl = node.files[0].url + '#toolbar=0&navpanes=0&statusbar=0'
|
|
|
+ node.iframeUrl = creationFile.url + '#toolbar=0&navpanes=0&statusbar=0'
|
|
|
} else if (mime === 'text/html') {
|
|
|
- node.iframeUrl = node.files[0].url
|
|
|
+ node.iframeUrl = creationFile.url
|
|
|
} else if (['audio', 'video'].some(type => mime.includes(type))) {
|
|
|
node.mediaItem = {
|
|
|
is: mime.includes('audio') ? 'audio' : 'video',
|
|
|
- src: node.files[0].url
|
|
|
+ src: creationFile.url
|
|
|
}
|
|
|
} else if (node.piece && node.piece.url) {
|
|
|
node.iframeUrl = node.piece.url
|
|
@@ -57,15 +59,16 @@ export default {
|
|
|
} else if (node.piece && node.piece.url) {
|
|
|
node.iframeUrl = node.piece.url
|
|
|
}
|
|
|
+
|
|
|
+ if (node.images && node.images.length) {
|
|
|
+ node.image = node.images.shift()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (node.date) {
|
|
|
node.date.start = formatDate(node.date.start)
|
|
|
}
|
|
|
|
|
|
- if (node.images && node.images.length) {
|
|
|
- node.image = node.images[0]
|
|
|
- }
|
|
|
|
|
|
if ('creations' in node) {
|
|
|
if (node.creations) {
|