Commit ad971865 authored by Anton's avatar Anton

Post annotations to extra api host

parent bbd62bda
Pipeline #30609 passed with stage
in 1 minute and 18 seconds
...@@ -386,6 +386,7 @@ ...@@ -386,6 +386,7 @@
if (this.mode === 'local') { if (this.mode === 'local') {
target = Object.assign({}, annotation.target) target = Object.assign({}, annotation.target)
target.selector.type = 'FragmentSelector' target.selector.type = 'FragmentSelector'
target.selector.value = { t: [target.selector.value.t, target.selector.value.t] }
} }
else target = this.timeline.getInterval(annotation.target.selector.value['date-time:t']) else target = this.timeline.getInterval(annotation.target.selector.value['date-time:t'])
target.type = 'Video' target.type = 'Video'
...@@ -393,24 +394,21 @@ ...@@ -393,24 +394,21 @@
console.log('target', target) console.log('target', target)
const payload = new Annotation(ObjectUtil.merge(annotation, target ? { target } : {})) const payload = new Annotation(ObjectUtil.merge(annotation, target ? { target } : {}))
console.debug('createAnnotation', payload.toObject()) console.debug('createAnnotation', payload.toObject())
// const pbares = await this.$axios.post( const pbares = await this.$axios.post(
// `${process.env.PBA_API_HOST}videos/annotations/?media_url=https:%2F%2Fdams-staging.pinabausch.org%2Fmedia%2Fvideos%2Fvideo.mp4&format=json-ld`, `${process.env.PBA_API_HOST}videos/annotations/?format=json-ld&media_url=https:%2F%2Fdams-staging.pinabausch.org%2Fmedia%2Fvideos%2Fvideo.mp4`,
// payload.toObject(), payload.toObject(),
// { {
// headers: { // headers: {
// 'Accept': 'application/ld+json', // 'Accept-Type': 'application/ld+json',
// 'Content-Type': 'application/ld+json' // 'Content-Type': 'application/ld+json'
// }, // },
// // params: { // params: {
// // media_url: video.body.source.id // media_url: video.body.source.id
// // }, // },
// auth: { auth: this.$store.state.auth.pba
// username: process.env.PBA_API_USER, }
// password: process.env.PBA_API_PASS )
// } console.log('pba res', pbares)
// }
// )
// console.log('pba res', pbares)
const result = await this.$store.dispatch('annotations/post', payload) const result = await this.$store.dispatch('annotations/post', payload)
if (result.body.type === 'VocabularyEntry' && !result.body.value) { if (result.body.type === 'VocabularyEntry' && !result.body.value) {
const entry = await this.$vocabularies.getEntry(result.body.source.id) const entry = await this.$vocabularies.getEntry(result.body.source.id)
......
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