#885 check bitsteam fail

This commit is contained in:
Dániel Péter Sipos
2020-11-06 13:54:11 +01:00
parent d17b874156
commit 1913094bdf
2 changed files with 42 additions and 30 deletions

View File

@@ -4,7 +4,8 @@
message="{{ 'loading.default' | translate }}"
[showMessage]="false"
></ds-loading>
<div class="media-viewer" *ngIf="mediaList.length > 0">
<div class="media-viewer" *ngIf="!isLoading">
<ng-container *ngIf="mediaList.length > 0">
<ng-container *ngIf="options.video">
<ng-container
*ngIf="
@@ -19,11 +20,13 @@
<ds-media-viewer-image [images]="mediaList"></ds-media-viewer-image>
</ng-container>
</ng-container>
</ng-container>
<ng-container
*ngIf="
(!options.image || mediaList[0]?.format !== 'image') &&
((!options.image || mediaList[0]?.format !== 'image') &&
(!options.video || mediaList[0]?.format !== 'video') &&
(!options.video || mediaList[0]?.format !== 'audio')
(!options.video || mediaList[0]?.format !== 'audio')) ||
mediaList.length === 0
"
>
<ds-media-viewer-image

View File

@@ -41,8 +41,16 @@ export class MediaViewerComponent implements OnInit {
this.mediaList$ = new BehaviorSubject([]);
this.isLoading = true;
this.loadRemoteData('ORIGINAL').subscribe((bitstreamsRD) => {
if (bitstreamsRD.payload.page.length === 0) {
this.isLoading = false;
this.mediaList$.next([]);
} else {
this.loadRemoteData('THUMBNAIL').subscribe((thumbnailsRD) => {
for (let index = 0; index < bitstreamsRD.payload.page.length; index++) {
for (
let index = 0;
index < bitstreamsRD.payload.page.length;
index++
) {
bitstreamsRD.payload.page[index].format
.pipe(getFirstSucceededRemoteDataPayload())
.subscribe((format) => {
@@ -57,6 +65,7 @@ export class MediaViewerComponent implements OnInit {
}
this.isLoading = false;
});
}
});
}