diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts index 4aac008140..304dd038c9 100644 --- a/frontend/src/utils/types.ts +++ b/frontend/src/utils/types.ts @@ -7,7 +7,6 @@ import { Recommendation, RelatedEntity, TournesolUserSettings, - Video, EntityNoExtraField, } from 'src/services/openapi'; @@ -39,7 +38,6 @@ export type EntityResult = | Recommendation | SimpleEntityResult; export type EntityObject = RelatedEntity | EntityNoExtraField; -export type VideoObject = Video; /** * An exhaustive list of route ids helping to enforce type checking in each diff --git a/frontend/src/utils/video.ts b/frontend/src/utils/video.ts index 15765c4a0d..a0a9de921f 100644 --- a/frontend/src/utils/video.ts +++ b/frontend/src/utils/video.ts @@ -1,5 +1,3 @@ -import { VideoObject } from './types'; - export function extractVideoId( idOrUrl: string, { ignoreVideoId = false } = {} @@ -38,29 +36,6 @@ export function isVideoIdValid(videoId: string) { return !!videoId.match(/^[A-Za-z0-9-_]{11}$/); } -/** - * Return the video id of an entity. - * - * If no field `uid` is found, return the value of the legacy `video_id` - * field instead. - * - * The `uid` is expected to have the form `{namespace}:{id}`. The potential - * occurrences of the delimiter `:` in the identifier are considered part of it. - * - * Example with different `uid`: - * - * yt:videoABCDEF -> videoABCDEF - * yt:video:ABCDE -> video:ABCDE - */ -export function videoIdFromEntity(entity: VideoObject): string { - if (entity.uid) { - const id = idFromUid(entity.uid); - if (id) return id; - } - - return entity.video_id; -} - export function idFromUid(uid: string): string { if (uid) { const uidSplit = uid.split(':');