Api request #84

Merged
KevinMidboe merged 39 commits from api_request into master 2018-03-19 14:46:19 +00:00
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 4bc94ae3b7 - Show all commits

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;
});
}