Now also has size of the existing file.
This commit is contained in:
@@ -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;
|
||||
module.exports = Movie;
|
||||
|
||||
@@ -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;
|
||||
module.exports = convertPlexToSeasoned;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user