Skip to content

Add update metadata route - #12

Open
Giska wants to merge 2 commits into
mainfrom
feature/add-metadata-route
Open

Giska wants to merge 2 commits into
mainfrom
feature/add-metadata-route

Conversation

@Giska

@Giska Giska commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@Giska
Giska requested a review from yma December 6, 2023 13:33
Comment thread src/types.ts
Comment on lines +549 to 560
export enum TextedVideoType {
Full = "Full",
Partial = "Partial",
InsertOnly = "InsertOnly",
}

export enum FileType {
Video = "Video",
Audio = "Audio",
Subtitle = "Subtitle",
Extra = "Extra",
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Il y a une raison d'utiliser enum plutôt que type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

J'aime bien les enum car on peut les reutiliser si on a besoin dans le code. Contrairement aux types

Comment thread src/types.ts Outdated
}

export interface Metadata {
export interface Metadata extends partialMetadata {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Si tu extends PartialMetadata alors les champs seront optionnels (?:) en plus d'être undefinable. Ça ne devrait pas être le cas avec Metadata.

Il y a moyen de réutiliser PartialMetadata en enlevant les ?: :

Suggested change
export interface Metadata extends partialMetadata {
export type Metadata = { [K in keyof partialMetadata]-?: partialMetadata[K] } & {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

alors ton type est littéralement incompréhensible. Et pour le coup les champs de metadata avec ? sont vraiment optionnels

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Il sont nullable mais pas optionnel non? Par optionnel je veux dire que si tu oublis de mettre le field dans l'object typescript ne fera pas de warning et la valeur sera undefined (pas null).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ils sont techniquement les deux. Car flubber va te renvoyer null si l'objet n'existe pas. Mais pour le coup tu peux lui envoyer un json partiel et il est content aussi. J'ai pas hyper envie d'envoyer tout l'objet metadata. Car il est tres rarement tout utilisé

Comment thread src/types.ts Outdated
broadcasterShowId: null;
}

export interface partialMetadata {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C'est normal le "p" minuscule?

Suggested change
export interface partialMetadata {
export interface PartialMetadata {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

C'est un oubli ça par contre

@Giska
Giska requested a review from yma December 6, 2023 14:25
@yma

yma commented May 27, 2025

Copy link
Copy Markdown

Elle est encore d'actualité cette PR?

@yma

yma commented Jan 5, 2026

Copy link
Copy Markdown

@Giska Elle est encore d'actualité cette PR?

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