Skip to content

Commit

Permalink
Add download handler tests and fix other failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
kdid committed Oct 12, 2023
1 parent 796d048 commit cf612e4
Show file tree
Hide file tree
Showing 6 changed files with 702 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/handlers/get-file-set-download.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const opensearchResponse = require("../api/response/opensearch");
const path = require("path");

/**
* Handler for download file set endpoint (currently only handles AV)
* Handler for download file set endpoint (currently only handles VIDEO)
*/
exports.handler = wrap(async (event) => {
console.log(event);
Expand Down Expand Up @@ -41,6 +41,8 @@ exports.handler = wrap(async (event) => {
});

function downloadAvailable(doc) {
// Note - audio is not currently implemented due to an issue with AWS
// & MediaConvert and our .m3u8 files
console.log("doc.found", doc.found);
console.log("doc._source.role", doc._source.role);
console.log("doc._source.streaming_url", doc._source.streaming_url);
Expand Down Expand Up @@ -70,9 +72,9 @@ async function processDownload(doc, email) {
const fileSetLabel = fileSet.label;
const workId = fileSet.work_id;
const fileType = fileSet.mime_type.split("/")[0];
const destinationKey = `av-downloads/${fileSetId}.mp4`; //TODO - here?
const destinationLocation = `s3://${destinationBucket}/av-downloads/${fileSetId}`; // TODO - here?
const settings = videoTranscodeSettings(sourceLocation, destinationLocation);
const destinationKey = `av-downloads/${fileSetId}.mp4`; //TODO - account for audio
const destinationLocation = `s3://${destinationBucket}/av-downloads/${fileSetId}`; // TODO - account for audio
const settings = videoTranscodeSettings(sourceLocation, destinationLocation); // TODO - account for audio

var params = {
stateMachineArn: process.env.AV_DOWNLOAD_STATE_MACHINE_ARN,
Expand Down
Loading

0 comments on commit cf612e4

Please sign in to comment.