Skip to content

Commit

Permalink
web app: Fix Recordings download URL problem
Browse files Browse the repository at this point in the history
As a result of a recent change, the download link in recordings was not
supporting right-click to copy the download URL. Now fixed.
  • Loading branch information
bennettpeter committed Jan 22, 2024
1 parent f3f9d89 commit c57f7a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h2>{{ 'dashboard.recordings.heading' | translate }}</h2>
<a href="{{URLencode('/Content/GetRecording?RecordedId=' + program.Recording.RecordedId)}}"
target="_blank" pTooltip="{{ 'dashboard.recordings.download' | translate }}"
tooltipPosition="left">
<i class="pi pi-download text-primary"></i></a>
<i class="pi pi-download text-primary" [id]="'download_'+ rowIndex"></i></a>
<button pButton pRipple icon="pi pi-ellipsis-v" class="p-button-text p-button-primary"
(click)="showContextMenu(program,$event)"></button>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,23 @@ export class RecordingsComponent implements OnInit {
return duration;
}

// return true causes default browser right click menu to show
// return false suppresses default browser right click menu
onContextMenu(program: ScheduleOrProgram, event: any) {
if (this.selection.length == 0)
return true;
if (event.target && event.target.id && event.target.id.startsWith('download_'))
return true;
if (this.selection.some((x) => !x)) {
// This happens if some entries have not been loaded
this.sendMessage('error', null, '', this.msg.UndefSelection);
return false;
}
if (this.selection.some((x) => x.Recording.RecordedId == program.Recording.RecordedId))
if (this.selection.some((x) => x.Recording.RecordedId == program.Recording.RecordedId)) {
this.showContextMenu(null, event);
return false;
return false;
}
return true;
}

onSelectChange() {
Expand Down

0 comments on commit c57f7a8

Please sign in to comment.