-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add update metadata route #12
base: main
Are you sure you want to change the base?
Conversation
export enum TextedVideoType { | ||
Full = "Full", | ||
Partial = "Partial", | ||
InsertOnly = "InsertOnly", | ||
} | ||
|
||
export enum FileType { | ||
Video = "Video", | ||
Audio = "Audio", | ||
Subtitle = "Subtitle", | ||
Extra = "Extra", | ||
} |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
src/types.ts
Outdated
@@ -504,18 +504,59 @@ export interface FluffyStream { | |||
subtitleType: string; | |||
} | |||
|
|||
export interface Metadata { | |||
export interface Metadata extends partialMetadata { |
There was a problem hiding this comment.
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 ?:
:
export interface Metadata extends partialMetadata { | |
export type Metadata = { [K in keyof partialMetadata]-?: partialMetadata[K] } & { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
).
There was a problem hiding this comment.
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é
src/types.ts
Outdated
broadcasterShowId: null; | ||
} | ||
|
||
export interface partialMetadata { |
There was a problem hiding this comment.
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?
export interface partialMetadata { | |
export interface PartialMetadata { |
There was a problem hiding this comment.
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
No description provided.