@ -30,6 +30,7 @@ export const normalizeRawOmdbData = (
Country ,
Country ,
DVD ,
DVD ,
Director ,
Director ,
Episode ,
Genre ,
Genre ,
Language : _language ,
Language : _language ,
Metascore : _metascore ,
Metascore : _metascore ,
@ -40,6 +41,7 @@ export const normalizeRawOmdbData = (
Ratings ,
Ratings ,
Released ,
Released ,
Runtime ,
Runtime ,
Season ,
Title ,
Title ,
Type ,
Type ,
Website ,
Website ,
@ -48,6 +50,7 @@ export const normalizeRawOmdbData = (
imdbID ,
imdbID ,
imdbRating : _imdbRating ,
imdbRating : _imdbRating ,
imdbVotes : _imdbVotes ,
imdbVotes : _imdbVotes ,
seriesID ,
totalSeasons ,
totalSeasons ,
. . . rest
. . . rest
} = rawOmdbData ;
} = rawOmdbData ;
@ -61,13 +64,14 @@ export const normalizeRawOmdbData = (
return {
return {
. . . createRequiredField ( 'actors' , Actors , stringToArray ) ,
. . . createRequiredField ( 'actors' , Actors , stringToArray ) ,
. . . createRequired Field ( 'awards' , Awards , identity ) ,
. . . createOptional Field ( 'awards' , Awards , identity ) ,
. . . createOptionalField ( 'boxOffice' , BoxOffice , identity ) ,
. . . createOptionalField ( 'boxOffice' , BoxOffice , identity ) ,
. . . createOptionalField ( 'contentRating' , Rated , identity ) ,
. . . createOptionalField ( 'contentRating' , Rated , identity ) ,
. . . createRequiredField ( 'description' , Plot , identity ) ,
. . . createRequiredField ( 'description' , Plot , identity ) ,
. . . createOptionalField ( 'directors' , Director , stringToArray ) ,
. . . createOptionalField ( 'directors' , Director , stringToArray ) ,
. . . createRequiredField ( 'duration' , Runtime , stringToDuration ) ,
. . . createRequiredField ( 'duration' , Runtime , stringToDuration ) ,
. . . createOptionalField ( 'dvdReleaseDate' , DVD , identity ) ,
. . . createOptionalField ( 'dvdReleaseDate' , DVD , identity ) ,
. . . createOptionalField ( 'episodeNumber' , Episode , stringToNumber ) ,
. . . createRequiredField ( 'genres' , Genre , stringToArray ) ,
. . . createRequiredField ( 'genres' , Genre , stringToArray ) ,
. . . createRequiredField ( 'imdbId' , imdbID , identity ) ,
. . . createRequiredField ( 'imdbId' , imdbID , identity ) ,
. . . createRequiredField ( 'posterUrl' , Poster , identity ) ,
. . . createRequiredField ( 'posterUrl' , Poster , identity ) ,
@ -79,6 +83,8 @@ export const normalizeRawOmdbData = (
omdbRatingsToNormalizedRatings ,
omdbRatingsToNormalizedRatings ,
) ,
) ,
. . . createRequiredField ( 'releaseDate' , Released , identity ) ,
. . . createRequiredField ( 'releaseDate' , Released , identity ) ,
. . . createOptionalField ( 'seasonNumber' , Season , stringToNumber ) ,
. . . createOptionalField ( 'seriesImdbId' , seriesID , identity ) ,
. . . createRequiredField ( 'title' , Title , identity ) ,
. . . createRequiredField ( 'title' , Title , identity ) ,
. . . createOptionalField ( 'totalSeasons' , totalSeasons , stringToNumber ) ,
. . . createOptionalField ( 'totalSeasons' , totalSeasons , stringToNumber ) ,
. . . createRequiredField ( 'type' , Type , identity ) ,
. . . createRequiredField ( 'type' , Type , identity ) ,