Commit a4dcc8c5 authored by anton's avatar anton
Browse files

Handle metadata errors in media/annotate

parent bcc742a5
......@@ -130,7 +130,8 @@ export default {
annotate_timeline_forbidden: 'You are not allowed to annotate this Timeline.',
media_could_not_be_accessed: 'The supplied media URL could not be accessed.',
access_to_media_denied: 'Access to the media URL was denied.',
duplicate_timeline_failed: 'Duplicate Timeline failed: {error}'
duplicate_timeline_failed: 'Duplicate Timeline failed: {error}',
failed_to_get_media_metadata: 'Failed to fetch media metadata: {error}'
},
labels: {
rejected: 'Rejected.',
......
......@@ -381,14 +381,22 @@
this.mayEdit = !!(acl || {}).get
}
catch (err) {
this.$handleError(err)
this.$handleError(this, err)
}
}
this.$root.$emit('setBackButton', '/piecemaker/timelines/' + parseURI(this.media.target.id).uuid + '/media')
if (this.media) {
let duration
if (this.media.target.selector) duration = this.media.target.selector.getDuration()
if (!duration) this.metadata = await this.$store.dispatch('metadata/get', this.media)
if (!duration) {
try {
this.metadata = await this.$store.dispatch('metadata/get', this.media)
}
catch (err) {
this.metadata = await this.$store.dispatch('metadata/getLocal', this.media)
this.$handleError(this, err, 'errors.failed_to_get_media_metadata')
}
}
else this.metadata = await this.$store.dispatch('metadata/getLocal', this.media)
}
},
......
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