When a element is not found in plex it now still gets a matchedInPlex value, now False when not found.

This commit is contained in:
2018-02-26 16:59:56 +01:00
parent bf4cf8bef1
commit 4bc94ae3b7
2 changed files with 12 additions and 5 deletions

View File

@@ -61,4 +61,6 @@ typings/
# - - - - -
# My own gitignore files and folders
shows.db
conf/
conf/development.json
# conf/development-prod.json

View File

@@ -26,10 +26,15 @@ class PlexRepository {
compareTmdbToPlex(tmdb, plexResult) {
return Promise.resolve()
.then(() => {
plexResult.results.map((plexItem) => {
if (tmdb.title === plexItem.title && tmdb.year === plexItem.year) { tmdb.matchedInPlex = true; }
return tmdb;
});
if (plexResult.results.length === 0) {
tmdb.matchedInPlex = false
}
else {
plexResult.results.map((plexItem) => {
if (tmdb.title === plexItem.title && tmdb.year === plexItem.year) { tmdb.matchedInPlex = true; }
return tmdb;
});
}
return tmdb;
});
}