Rewrote how local plex library is indexed and what it returns. After searching plex the response is separated into three classes by types (movie, show & episode). Plex also has a function for inputing a (tmdb)movie object and searching for matches of name & type in plex. If a match the object matchedInPlex variable is set to true.

This commit is contained in:
2018-10-29 21:01:16 +01:00
parent 8f5bd44e4d
commit 161a466ab7
8 changed files with 171 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
const Show = require('src/plex/types/show');
function convertPlexToShow(plexShow) {
const show = new Show(plexShow.title, plexShow.year);
show.summary = plexShow.summary;
show.rating = plexShow.rating;
show.seasons = plexShow.childCount;
show.episodes = plexShow.leafCount;
return show;
}
module.exports = convertPlexToShow;