Skip to content

Commit

Permalink
Change code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Feb 11, 2025
1 parent 94be812 commit 75e17ed
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions resources/assets/js/videos/videoContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -529,24 +529,20 @@ export default {
handleVideoInformationResponse(response) {
let video = response.body;
// Show only warning to user because of https://github.com/orgs/biigle/discussions/1076#discussioncomment-12083987
this.invalidMoovAtomPosition = video.error === this.errors['moov-atom'];
// No need to check for errors if a warning is present, as it occurs after all error checks
if (!this.invalidMoovAtomPosition) {
if (video.error === this.errors['not-found']) {
throw new VideoNotFoundError();
} else if (video.error === this.errors['mimetype']) {
throw new VideoMimeTypeError();
} else if (video.error === this.errors['codec']) {
throw new VideoCodecError();
} else if (video.error === this.errors['malformed']) {
throw new VideoMalformedError();
} else if (video.error === this.errors['too-large']) {
throw new VideoTooLargeError();
} else if (video.size === null) {
throw new VideoNotProcessedError();
}
if (video.error === this.errors['not-found']) {
throw new VideoNotFoundError();
} else if (video.error === this.errors['mimetype']) {
throw new VideoMimeTypeError();
} else if (video.error === this.errors['codec']) {
throw new VideoCodecError();
} else if (video.error === this.errors['malformed']) {
throw new VideoMalformedError();
} else if (video.error === this.errors['too-large']) {
throw new VideoTooLargeError();
} else if (video.error === this.errors['moov-atom']) {
this.invalidMoovAtomPosition = true;
} else if (video.size === null) {
throw new VideoNotProcessedError();
}
this.error = null;
Expand Down

0 comments on commit 75e17ed

Please sign in to comment.