diff --git a/seasoned_api/src/media_classes/movie.js b/seasoned_api/src/media_classes/movie.js index 19063ad..98eb2ee 100644 --- a/seasoned_api/src/media_classes/movie.js +++ b/seasoned_api/src/media_classes/movie.js @@ -7,7 +7,7 @@ class Movie { this.release_date = undefined; this.summary = undefined; this.rating = undefined; - this.poster = undefined; + this.poster_path = undefined; this.background = undefined; this.genre = undefined; this.date_added = undefined; @@ -18,4 +18,4 @@ class Movie { } } -module.exports = Movie; \ No newline at end of file +module.exports = Movie; diff --git a/seasoned_api/src/plex/convertPlexToSeasoned.js b/seasoned_api/src/plex/convertPlexToSeasoned.js index 6d0ad14..026b2f1 100644 --- a/seasoned_api/src/plex/convertPlexToSeasoned.js +++ b/seasoned_api/src/plex/convertPlexToSeasoned.js @@ -17,6 +17,15 @@ function convertPlexToSeasoned(plexObject) { movie.mediaInfo = plexObject.Media; + // Don't need a for-loop when we have it in json format + file_sizes = [] + for (let movie_info of plexObject.Media) { + for (let file_data of movie_info.Part) { + file_sizes.push(file_data.size) + } + } + movie.size = file_sizes; + return movie; } else if (mediaType === 'show') { @@ -36,4 +45,4 @@ function convertPlexToSeasoned(plexObject) { } } -module.exports = convertPlexToSeasoned; \ No newline at end of file +module.exports = convertPlexToSeasoned; diff --git a/seasoned_api/src/tmdb/convertTmdbToSeasoned.js b/seasoned_api/src/tmdb/convertTmdbToSeasoned.js index 1643e8d..c5ced79 100644 --- a/seasoned_api/src/tmdb/convertTmdbToSeasoned.js +++ b/seasoned_api/src/tmdb/convertTmdbToSeasoned.js @@ -25,8 +25,8 @@ function convertTmdbToSeasoned(tmdbObject, strictType=undefined) { movie.id = tmdbObject.id; movie.summary = tmdbObject.overview; movie.rating = tmdbObject.vote_average; - movie.poster = tmdbObject.poster_path; - movie.background = tmdbObject.backdrop_path; + movie.poster_path = tmdbObject.poster_path; + movie.background_path = tmdbObject.backdrop_path; movie.genre = tmdbObject.genre_ids; movie.popularity = tmdbObject.popularity; @@ -42,8 +42,8 @@ function convertTmdbToSeasoned(tmdbObject, strictType=undefined) { show.id = tmdbObject.id; show.summary = tmdbObject.overview; show.rating = tmdbObject.vote_average; - show.poster = tmdbObject.poster_path; - show.background = tmdbObject.backdrop_path; + show.poster_path = tmdbObject.poster_path; + show.background_path = tmdbObject.backdrop_path; show.genre = tmdbObject.genre_ids; show.popularity = tmdbObject.popularity;