Commit 84d6a7a5 authored by anton's avatar anton
Browse files

Update from release_2_1

parents 29239b81 48cfc77e
Pipeline #63809 passed with stage
in 3 minutes and 32 seconds
......@@ -16,6 +16,7 @@ and this project adheres to
reference date, if available (e.g. live streams)
- `Live` indicator for YouTube live streams in post-annotator
- Edit media screen allows adding duration for live streams once archived
- Duration field on edit media screen
### Changed
......@@ -26,6 +27,10 @@ reference date, if available (e.g. live streams)
- Exception on edit media screen when media duration is unknown
### Updated
- [sift](https://github.com/crcn/sift.js/) to v13.1.10
## [2.1.2] - 2020-05-29
......
......@@ -15078,9 +15078,9 @@
"dev": true
},
"sift": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz",
"integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g=="
"version": "13.1.10",
"resolved": "https://registry.npmjs.org/sift/-/sift-13.1.10.tgz",
"integrity": "sha512-Z+7ZMTbnmbuVCwER+8jNerXpuJNYsxFSZf1er8VUqF/qYdgTrG5o5TQ7C6nWDycQY/TA1pczVCj58y5RvrUtrA=="
},
"signal-exit": {
"version": "3.0.2",
......
......@@ -147,6 +147,7 @@ export default {
accept_terms: 'I accept the Terms and Conditions',
author: 'Author',
creator: 'Creator',
duration_seconds: 'Duration (s)',
biovision_hierarchy: 'Biovision Hierarchy',
anonymous_creator: 'Anonymous',
unknown_creator: 'Unknown',
......
......@@ -114,7 +114,7 @@
{
label: this.$t('buttons.add_duration'),
handler () {
context.durationOverride = context.meta.duration * 1000
context.payload.duration = context.meta.duration
}
}
],
......@@ -122,7 +122,6 @@
apiPayload: undefined,
selectorOverride: undefined,
showDurationOverride: false,
durationOverride: undefined,
titlePayload: undefined,
media: undefined,
meta: undefined,
......@@ -132,13 +131,18 @@
.then(async result => {
context.$q.loading.show()
let duration
if (result.target.selector) {
const duration = result.target.selector.getDuration()
if (!duration) {
this.meta = await this.$store.dispatch('metadata/get', result)
this.showDurationOverride = !!this.meta.duration
}
else this.meta = await this.$store.dispatch('metadata/getLocal', result)
duration = result.target.selector.getDuration()
}
if (!duration) {
this.meta = await this.$store.dispatch('metadata/get', result)
this.showDurationOverride = !!this.meta.duration
}
else {
duration = (duration.as('milliseconds') * 0.001).toFixed(3)
this.meta = await this.$store.dispatch('metadata/getLocal', result)
}
this.annotation = result
......@@ -154,6 +158,7 @@
_uuid: parseURI(result.target.id).uuid,
url: result.body.source.id,
id: result.id,
duration,
title: this.meta.title,
timeline: result.target.id,
tags
......@@ -161,6 +166,11 @@
}),
schema: {
fields: {
duration: {
fullWidth: true,
type: 'text',
label: 'labels.duration_seconds'
},
url: {
fullWidth: true,
type: 'text',
......@@ -201,16 +211,23 @@
await titleHelper.update(context.$store, context.titlePayload.id, context.payload.title)
}
let selector
if (context.durationOverride) context.annotation.target.selector._valueDuration = context.durationOverride
if (context.payload.duration) {
const duration = Math.round(parseFloat(context.payload.duration) * 1000)
const target = context.map.getInterval(
DateTime.fromMillis(context.annotation.target.selector._valueMillis).toISO(),
DateTime.fromMillis(context.annotation.target.selector._valueMillis)
.plus(duration).toISO())
selector = target.selector.toObject()
}
if (context.selectorOverride) {
const
durationMs = context.annotation.target.selector._valueDuration,
durationMs = (selector || context.annotation.target.selector)._valueDuration,
end = durationMs ? DateTime.fromISO(context.selectorOverride, {setZone: true})
.plus(durationMs).toISO() : undefined
const target = context.map.getInterval(context.selectorOverride, end)
selector = target.selector.toObject()
}
else selector = context.annotation.target.selector.toObject()
else selector = (selector || context.annotation.target.selector).toObject()
context.apiPayload = {
target: {
id: context.payload.timeline,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment