migrated audio file downloads to new system. still untested with playlists

video/audio player now doesnt show share button when uid isn't present, user will be notified of this through a snackbar as well
This commit is contained in:
Isaac Grynsztein
2020-04-21 03:16:39 -04:00
parent 6fe7d20498
commit a6534f66a6
3 changed files with 83 additions and 191 deletions

View File

@@ -30,6 +30,6 @@
</div>
<div *ngIf="playlist.length === 1">
<button class="save-button" color="primary" (click)="downloadFile()" [disabled]="downloading" mat-fab><mat-icon class="save-icon">save</mat-icon><mat-spinner *ngIf="downloading" class="spinner" [diameter]="50"></mat-spinner></button>
<button *ngIf="!is_shared && type !== 'subscription'" class="share-button" color="primary" (click)="openShareDialog()" mat-fab><mat-icon class="save-icon">share</mat-icon></button>
<button *ngIf="!is_shared && uid && uid !== 'false' && type !== 'subscription'" class="share-button" color="primary" (click)="openShareDialog()" mat-fab><mat-icon class="save-icon">share</mat-icon></button>
</div>
</div>

View File

@@ -125,6 +125,10 @@ export class PlayerComponent implements OnInit {
const already_has_filenames = !!this.fileNames;
this.postsService.getFile(this.uid, null).subscribe(res => {
this.db_file = res['file'];
if (!this.db_file) {
this.openSnackBar('Failed to get file information from the server.', 'Dismiss');
return;
}
if (!this.fileNames) {
// means it's a shared video
if (!this.id) {