Skip to content

feat(add-multi-source-support): add multi source support #77

Open
axel-biehler wants to merge 24 commits intomainfrom
feat/add-multi-source-support
Open

feat(add-multi-source-support): add multi source support #77
axel-biehler wants to merge 24 commits intomainfrom
feat/add-multi-source-support

Conversation

@axel-biehler
Copy link
Contributor

No description provided.

@axel-biehler axel-biehler self-assigned this Apr 24, 2025
@axel-biehler axel-biehler force-pushed the feat/add-multi-source-support branch from ea38848 to ad2307f Compare April 24, 2025 11:24
@axel-biehler axel-biehler force-pushed the feat/add-multi-source-support branch from 7212421 to f6ef12e Compare April 24, 2025 13:44
@axel-biehler axel-biehler marked this pull request as ready for review April 25, 2025 12:19
status: EventStatus;
endpoints: EventEndpoint[];
logs: EventLog[];
inputType: InputType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this in the Source object itself instead of having it next to the source?

SrtDecryptionAlgorithm,
} from '@trackflix-live/types';
import { JSONSchemaType } from 'ajv';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to find a way to avoid duplication here, it's would be crazy to have to edit all the schemas when we just want to make a small change

if (!validate(body)) {
throw new BadRequestError('Body does not match schema.');
}
if (!body) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't AJV validate this already? What is the issue here?

if (isSrtCaller(source, type)) {
return this.buildSrtCaller(source, inputName);
}
return {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we just throw an error here? It shouldn't be possible this reach this return statement right?

@@ -1,3 +1,5 @@
import { InputType } from '@aws-sdk/client-medialive';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to couple our shared types with the medialive library, we should redefine InputType ourselves here in this file.

}

export type S3Source = string;
export type S3Source = { inputType: InputType; value: string };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want inputType to be something like InputType.S3 or something, any input type cannot be here, it should be the specific one for the source.

Same for all of them in this file.

TsFile,
} from '@trackflix-live/types';
import { InputType } from '@aws-sdk/client-medialive';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All theses functions shouldn't take unknown as a parameter, they should take Source and only check for the inputType.


export type S3Source = { inputType: InputType.MP4_FILE; value: string };

export type TsFile = { inputType: InputType.TS_FILE; value: string };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make sure all those types end with Source?

TsFileSource, HlsSource, etc...

@alexandre-snr
Copy link
Member

All input types have been tested apart from MediaConnect, however critical information is missing from the front-end which would make the product unusable (you would have to go look the information on the AWS console)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants