Now also has size of the existing file.

This commit is contained in:
2018-02-05 13:41:41 +01:00
parent 0c3ad3a95e
commit bd0c7b8ab5
3 changed files with 16 additions and 7 deletions

View File

@@ -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;