parent
b8f3cac3fc
commit
7a18087a1b
@ -1,9 +1,9 @@ |
|||||||
import { describe, it, expect } from '@jest/globals'; |
import { describe, it, expect } from '@jest/globals'; |
||||||
|
|
||||||
import { createLocalMoviesClient } from './local'; |
import { createInternalMoviesClient } from './internal'; |
||||||
|
|
||||||
describe('createLocalMoviesClient', () => { |
describe('createInternalMoviesClient', () => { |
||||||
const client = createLocalMoviesClient(); |
const client = createInternalMoviesClient(); |
||||||
|
|
||||||
it('returns data for internal movie id', async () => { |
it('returns data for internal movie id', async () => { |
||||||
const result = await client.getMovieMetadataByInternalId(11528860); |
const result = await client.getMovieMetadataByInternalId(11528860); |
@ -0,0 +1,77 @@ |
|||||||
|
export type OmdbMovieData = { |
||||||
|
Actors: string; |
||||||
|
Awards: string; |
||||||
|
BoxOffice: string; |
||||||
|
Country: string; |
||||||
|
DVD: string; |
||||||
|
Director: string; |
||||||
|
Genre: string; |
||||||
|
Language: string; |
||||||
|
Metascore: string; |
||||||
|
Plot: string; |
||||||
|
Poster: string; |
||||||
|
Production: string; |
||||||
|
Rated: string; |
||||||
|
Ratings: { |
||||||
|
Source: string; |
||||||
|
Value: string; |
||||||
|
}[]; |
||||||
|
Released: string; |
||||||
|
Runtime: string; |
||||||
|
Title: string; |
||||||
|
Type: string; |
||||||
|
Website: string; |
||||||
|
Writer: string; |
||||||
|
Year: string; |
||||||
|
imdbID: string; |
||||||
|
imdbRating: string; |
||||||
|
imdbVotes: string; |
||||||
|
}; |
||||||
|
|
||||||
|
type InternalMovieData = { |
||||||
|
/** |
||||||
|
* Description in local language |
||||||
|
*/ |
||||||
|
description: string; |
||||||
|
/** |
||||||
|
* A whole number of minutes, presumably |
||||||
|
*/ |
||||||
|
duration: number; |
||||||
|
id: number; |
||||||
|
imdbId: string; |
||||||
|
/** |
||||||
|
* Two-letter codes |
||||||
|
*/ |
||||||
|
languages: string[]; |
||||||
|
/** |
||||||
|
* Two-letter code |
||||||
|
*/ |
||||||
|
originalLanguage: string; |
||||||
|
productionYear: number; |
||||||
|
studios: string[]; |
||||||
|
/** |
||||||
|
* Title in local language |
||||||
|
*/ |
||||||
|
title: string; |
||||||
|
userrating: { |
||||||
|
countStar1: number; |
||||||
|
countStar2: number; |
||||||
|
countStar3: number; |
||||||
|
countStar4: number; |
||||||
|
countStar5: number; |
||||||
|
countTotal: number; |
||||||
|
}; |
||||||
|
}; |
||||||
|
|
||||||
|
export type InternalMoviesProvider = { |
||||||
|
getMovieMetadataByInternalId( |
||||||
|
internalId: number, |
||||||
|
): Promise<InternalMovieData | undefined>; |
||||||
|
getMovieMetadataByImdbId( |
||||||
|
imdbId: string, |
||||||
|
): Promise<InternalMovieData | undefined>; |
||||||
|
}; |
||||||
|
|
||||||
|
export type OmdbMoviesProvider = { |
||||||
|
getMovieMetadata(imdbId: string): Promise<OmdbMovieData | undefined>; |
||||||
|
}; |
Loading…
Reference in new issue