* All file imports change from commonjs to es-module * Improved plex error responses back from api * Converted viewHistory to es module * Es-module requires file extension, updated all imports * Fix esmodule not having __dirname defined in scope * Replace dynamic-require with fs readFileSync * Short message service module function is exported as default * Resolved lint issues & ignore import/extension rule until typescript * All tests file imports changed from commonjs to es-module * Import json fixtures with new helper
14 lines
329 B
JavaScript
14 lines
329 B
JavaScript
import Show from "./types/show.js";
|
|
|
|
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;
|
|
}
|
|
|
|
export default convertPlexToShow;
|