Es-module requires file extension, updated all imports
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
"url": "https://www.opensource.org/licenses/mit-license.php"
|
"url": "https://www.opensource.org/licenses/mit-license.php"
|
||||||
},
|
},
|
||||||
"main": "webserver/server.js",
|
"main": "webserver/server.js",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "SEASONED_CONFIG=configurations/production.json NODE_ENV=production node src/webserver/server.js",
|
"start": "SEASONED_CONFIG=configurations/production.json NODE_ENV=production node src/webserver/server.js",
|
||||||
"dev": "SEASONED_CONFIG=configurations/development.json NODE_ENV=development node src/webserver/server.js",
|
"dev": "SEASONED_CONFIG=configurations/development.json NODE_ENV=development node src/webserver/server.js",
|
||||||
|
|||||||
11
src/cache/redis.js
vendored
11
src/cache/redis.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
import redis from "redis";
|
import redis from "redis";
|
||||||
import Configuration from "../config/configuration";
|
import Configuration from "../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
let client;
|
let client;
|
||||||
@@ -38,7 +38,7 @@ try {
|
|||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
export function set(key, value, TTL = 10800) {
|
function set(key, value, TTL = 10800) {
|
||||||
if (value == null || key == null) return null;
|
if (value == null || key == null) return null;
|
||||||
|
|
||||||
const json = JSON.stringify(value);
|
const json = JSON.stringify(value);
|
||||||
@@ -61,7 +61,7 @@ export function set(key, value, TTL = 10800) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function get(key) {
|
function get(key) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
client.get(key, (error, reply) => {
|
client.get(key, (error, reply) => {
|
||||||
if (reply === null) {
|
if (reply === null) {
|
||||||
@@ -72,3 +72,8 @@ export function get(key) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
set,
|
||||||
|
get
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Filters from "./filters";
|
import Filters from "./filters.js";
|
||||||
import EnvironmentVariables from "./environmentVariables";
|
import EnvironmentVariables from "./environmentVariables.js";
|
||||||
|
|
||||||
class Field {
|
class Field {
|
||||||
constructor(rawValue, environmentVariables) {
|
constructor(rawValue, environmentVariables) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import SqliteDatabase from "./sqliteDatabase";
|
import SqliteDatabase from "./sqliteDatabase.js";
|
||||||
import Configuration from "../config/configuration";
|
import Configuration from "../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
|
|
||||||
import Media from "./media";
|
import Media from "./media.js";
|
||||||
|
|
||||||
class Plex extends Media {
|
class Plex extends Media {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
import Media from "./media";
|
import Media from "./media.js";
|
||||||
|
|
||||||
class TMDB extends Media {
|
class TMDB extends Media {
|
||||||
// constructor(...args) {
|
// constructor(...args) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Configuration from "../config/configuration";
|
import Configuration from "../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import http from "http";
|
|||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
import PythonShell from "python-shell";
|
import PythonShell from "python-shell";
|
||||||
|
|
||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
import cache from "../cache/redis";
|
import cache from "../cache/redis.js";
|
||||||
|
|
||||||
function getMagnetFromURL(url) {
|
function getMagnetFromURL(url) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Episode from "./types/episode";
|
import Episode from "./types/episode.js";
|
||||||
|
|
||||||
function convertPlexToEpisode(plexEpisode) {
|
function convertPlexToEpisode(plexEpisode) {
|
||||||
const episode = new Episode(
|
const episode = new Episode(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Movie from "./types/movie";
|
import Movie from "./types/movie.js";
|
||||||
|
|
||||||
function convertPlexToMovie(plexMovie) {
|
function convertPlexToMovie(plexMovie) {
|
||||||
const movie = new Movie(plexMovie.title, plexMovie.year);
|
const movie = new Movie(plexMovie.title, plexMovie.year);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
|
|
||||||
import Plex from "../media_classes/plex";
|
import Plex from "../media_classes/plex.js";
|
||||||
|
|
||||||
function translateAdded(date_string) {
|
function translateAdded(date_string) {
|
||||||
return new Date(date_string * 1000);
|
return new Date(date_string * 1000);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Show from "./types/show";
|
import Show from "./types/show.js";
|
||||||
|
|
||||||
function convertPlexToShow(plexShow) {
|
function convertPlexToShow(plexShow) {
|
||||||
const show = new Show(plexShow.title, plexShow.year);
|
const show = new Show(plexShow.title, plexShow.year);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import convertPlexToSeasoned from "./convertPlexToSeasoned";
|
import convertPlexToSeasoned from "./convertPlexToSeasoned.js";
|
||||||
import convertStreamToMediaInfo from "./convertStreamToMediaInfo";
|
import convertStreamToMediaInfo from "./convertStreamToMediaInfo.js";
|
||||||
import convertStreamToPlayer from "./stream/convertStreamToPlayer";
|
import convertStreamToPlayer from "./stream/convertStreamToPlayer.js";
|
||||||
import convertStreamToUser from "./stream/convertStreamToUser";
|
import convertStreamToUser from "./stream/convertStreamToUser.js";
|
||||||
import ConvertStreamToPlayback from "./stream/convertStreamToPlayback";
|
import ConvertStreamToPlayback from "./stream/convertStreamToPlayback.js";
|
||||||
|
|
||||||
function convertPlexToStream(plexStream) {
|
function convertPlexToStream(plexStream) {
|
||||||
const stream = convertPlexToSeasoned(plexStream);
|
const stream = convertPlexToSeasoned(plexStream);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import MediaInfo from "../media_classes/mediaInfo";
|
import MediaInfo from "../media_classes/mediaInfo.js";
|
||||||
|
|
||||||
function convertStreamToMediaInfo(plexStream) {
|
function convertStreamToMediaInfo(plexStream) {
|
||||||
const mediaInfo = new MediaInfo();
|
const mediaInfo = new MediaInfo();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import convertPlexToMovie from "./convertPlexToMovie";
|
import convertPlexToMovie from "./convertPlexToMovie.js";
|
||||||
import convertPlexToShow from "./convertPlexToShow";
|
import convertPlexToShow from "./convertPlexToShow.js";
|
||||||
import convertPlexToEpisode from "./convertPlexToEpisode";
|
import convertPlexToEpisode from "./convertPlexToEpisode.js";
|
||||||
import redisCache from "../cache/redis";
|
import redisCache from "../cache/redis.js";
|
||||||
|
|
||||||
class PlexRequestTimeoutError extends Error {
|
class PlexRequestTimeoutError extends Error {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import convertPlexToSeasoned from "./convertPlexToSeasoned";
|
import convertPlexToSeasoned from "./convertPlexToSeasoned.js";
|
||||||
import convertPlexToStream from "./convertPlexToStream";
|
import convertPlexToStream from "./convertPlexToStream.js";
|
||||||
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
function addAttributeIfTmdbInPlex(_tmdb, plexResult) {
|
function addAttributeIfTmdbInPlex(_tmdb, plexResult) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import PlexRepository from "./plexRepository";
|
import PlexRepository from "./plexRepository.js";
|
||||||
import TMDB from "../tmdb/tmdb";
|
import TMDB from "../tmdb/tmdb.js";
|
||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
import Configuration from "../config/configuration";
|
import Configuration from "../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const plexRepository = new PlexRepository(
|
const plexRepository = new PlexRepository(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Player from "../../media_classes/player";
|
import Player from "../../media_classes/player.js";
|
||||||
|
|
||||||
function convertStreamToPlayer(plexStream) {
|
function convertStreamToPlayer(plexStream) {
|
||||||
const player = new Player(plexStream.device, plexStream.address);
|
const player = new Player(plexStream.device, plexStream.address);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import User from "../../media_classes/user";
|
import User from "../../media_classes/user.js";
|
||||||
|
|
||||||
function convertStreamToUser(plexStream) {
|
function convertStreamToUser(plexStream) {
|
||||||
return new User(plexStream.id, plexStream.title);
|
return new User(plexStream.id, plexStream.title);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
// const configuration = require("../config/configuration").getInstance();
|
// const configuration = require("../config/configuration").getInstance();
|
||||||
// const TMDB = require("../tmdb/tmdb");
|
// const TMDB = require("../tmdb/tmdb");
|
||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
|
|
||||||
// const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
// const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ function validFilter(filterParam) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { validSort, validFilter };
|
export default { validSort, validFilter };
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
|
|
||||||
class SearchHistoryCreateDatabaseError extends Error {
|
class SearchHistoryCreateDatabaseError extends Error {
|
||||||
constructor(message = "an unexpected error occured", errorResponse = null) {
|
constructor(message = "an unexpected error occured", errorResponse = null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
import pythonShell from "python-shell";
|
import pythonShell from "python-shell";
|
||||||
import Stray from "./stray";
|
import Stray from "./stray.js";
|
||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
|
|
||||||
class StrayRepository {
|
class StrayRepository {
|
||||||
constructor(database) {
|
constructor(database) {
|
||||||
|
|||||||
@@ -75,4 +75,4 @@ class Tautulli {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Tautulli;
|
export default Tautulli;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
|
|
||||||
class Cache {
|
class Cache {
|
||||||
constructor(database) {
|
constructor(database) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import moviedb from "km-moviedb";
|
import moviedb from "km-moviedb";
|
||||||
import redisCache from "../cache/redis";
|
import redisCache from "../cache/redis.js";
|
||||||
|
|
||||||
const { Movie, Show, Person, Credits, ReleaseDates } = require("./types");
|
import { Movie, Show, Person, Credits, ReleaseDates } from "./types.js";
|
||||||
|
|
||||||
class TMDBNotFoundError extends Error {
|
class TMDBNotFoundError extends Error {
|
||||||
constructor(message) {
|
constructor(message) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Movie from "./types/movie";
|
import Movie from "./types/movie.js";
|
||||||
import Show from "./types/show";
|
import Show from "./types/show.js";
|
||||||
import Person from "./types/person";
|
import Person from "./types/person.js";
|
||||||
import Credits from "./types/credits";
|
import Credits from "./types/credits.js";
|
||||||
import ReleaseDates from "./types/releaseDates";
|
import ReleaseDates from "./types/releaseDates.js";
|
||||||
|
|
||||||
export default { Movie, Show, Person, Credits, ReleaseDates };
|
export { Movie, Show, Person, Credits, ReleaseDates };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
import Movie from "./movie";
|
import Movie from "./movie.js";
|
||||||
import Show from "./show";
|
import Show from "./show.js";
|
||||||
|
|
||||||
class CreditedMovie extends Movie {}
|
class CreditedMovie extends Movie {}
|
||||||
class CreditedShow extends Show {}
|
class CreditedShow extends Show {}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import jwt from "jsonwebtoken";
|
import jwt from "jsonwebtoken";
|
||||||
import User from "./user";
|
import User from "./user.js";
|
||||||
|
|
||||||
class Token {
|
class Token {
|
||||||
constructor(user, admin = false, settings = null) {
|
constructor(user, admin = false, settings = null) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
import establishedDatabase from "../database/database";
|
import establishedDatabase from "../database/database.js";
|
||||||
|
|
||||||
class LinkPlexUserError extends Error {
|
class LinkPlexUserError extends Error {
|
||||||
constructor(errorMessage = null) {
|
constructor(errorMessage = null) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import UserRepository from "./userRepository";
|
import UserRepository from "./userRepository.js";
|
||||||
|
|
||||||
class UserSecurity {
|
class UserSecurity {
|
||||||
constructor(database) {
|
constructor(database) {
|
||||||
|
|||||||
@@ -3,67 +3,69 @@ import Raven from "raven";
|
|||||||
import cookieParser from "cookie-parser";
|
import cookieParser from "cookie-parser";
|
||||||
import bodyParser from "body-parser";
|
import bodyParser from "body-parser";
|
||||||
|
|
||||||
import Configuration from "../config/configuration";
|
import Configuration from "../config/configuration.js";
|
||||||
|
|
||||||
import reqTokenToUser from "./middleware/reqTokenToUser";
|
|
||||||
import mustBeAuthenticated from "./middleware/mustBeAuthenticated";
|
|
||||||
import mustBeAdmin from "./middleware/mustBeAdmin";
|
|
||||||
import mustHaveAccountLinkedToPlex from "./middleware/mustHaveAccountLinkedToPlex";
|
|
||||||
|
|
||||||
import listController from "./controllers/list/listController";
|
|
||||||
import tautulli from "./controllers/user/viewHistory";
|
|
||||||
import SettingsController from "./controllers/user/settings";
|
|
||||||
import AuthenticatePlexAccountController from "./controllers/user/authenticatePlexAccount";
|
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
import UserRegisterController from "./controller/user/register";
|
import reqTokenToUser from "./middleware/reqTokenToUser.js";
|
||||||
import UserLoginController from "./controller/user/login";
|
import mustBeAuthenticated from "./middleware/mustBeAuthenticated.js";
|
||||||
import UserLogoutController from "./controller/user/logout";
|
import mustBeAdmin from "./middleware/mustBeAdmin.js";
|
||||||
import UserSearchHistoryController from "./controllers/user/searchHistory";
|
import mustHaveAccountLinkedToPlex from "./middleware/mustHaveAccountLinkedToPlex.js";
|
||||||
import UserRequestsController from "./controllers/user/requests";
|
|
||||||
|
|
||||||
import SearchMultiController from "./controllers/search/multiSearch";
|
import tautulli from "./controllers/user/viewHistory.js";
|
||||||
import SearchMovieController from "./controllers/search/movieSearch";
|
import {
|
||||||
import SearchShowController from "./controllers/search/showSearch";
|
getSettingsController,
|
||||||
import SearchPersonController from "./controllers/search/personSearch";
|
updateSettingsController
|
||||||
|
} from "./controllers/user/settings.js";
|
||||||
|
import AuthenticatePlexAccountController from "./controllers/user/authenticatePlexAccount.js";
|
||||||
|
|
||||||
import MovieCreditsController from "./controllers/movie/credits";
|
import UserRegisterController from "./controllers/user/register.js";
|
||||||
import MovieReleaseDatesController from "./controllers/movie/releaseDates";
|
import UserLoginController from "./controllers/user/login.js";
|
||||||
import MovieInfoController from "./controllers/movie/info";
|
import UserLogoutController from "./controllers/user/logout.js";
|
||||||
|
import UserSearchHistoryController from "./controllers/user/searchHistory.js";
|
||||||
|
import UserRequestsController from "./controllers/user/requests.js";
|
||||||
|
|
||||||
import ShowCreditsController from "./controllers/show/credits";
|
import SearchMultiController from "./controllers/search/multiSearch.js";
|
||||||
import ShowInfoController from "./controllers/show/info";
|
import SearchMovieController from "./controllers/search/movieSearch.js";
|
||||||
|
import SearchShowController from "./controllers/search/showSearch.js";
|
||||||
|
import SearchPersonController from "./controllers/search/personSearch.js";
|
||||||
|
|
||||||
import PersonCreditsController from "./controllers/person/credits";
|
import listController from "./controllers/list/listController.js";
|
||||||
import PersonInfoController from "./controllers/person/info";
|
|
||||||
|
|
||||||
import SeasonedAllController from "./controllers/seasoned/readStrays";
|
import MovieCreditsController from "./controllers/movie/credits.js";
|
||||||
import SeasonedInfoController from "./controllers/seasoned/strayById";
|
import MovieReleaseDatesController from "./controllers/movie/releaseDates.js";
|
||||||
import SeasonedVerifyController from "./controllers/seasoned/verifyStray";
|
import MovieInfoController from "./controllers/movie/info.js";
|
||||||
|
|
||||||
import PlexSearchController from "./controllers/plex/search";
|
import ShowCreditsController from "./controllers/show/credits.js";
|
||||||
import PlexRequestsAllController from "./controllres/plex/requests/all";
|
import ShowInfoController from "./controllers/show/info.js";
|
||||||
import PlexRequestsInfo from "./controllers/plex/updateRequested";
|
|
||||||
import PlexWatchLinkController from "./controllers/plex/watchDirectLink";
|
|
||||||
import PlexHookController from "./controllers/plex/hookDump";
|
|
||||||
import PlexSubmitRequestController from "./controllers/plex/submitRequest";
|
|
||||||
import PlexRequestInfo from "./controllers/plex/readRequest";
|
|
||||||
import PlexSearchRequestController from "./controllers/plex/searchRequest";
|
|
||||||
import PlexPlayingController from "./controllers/plex/plexPlaying";
|
|
||||||
import PlexSearchMediaController from "./controllres/plex/searchMedia";
|
|
||||||
import PlexUpdateRequestedController from "./controllers/plex/updateRequested";
|
|
||||||
|
|
||||||
import RequestFetchAllController from "./controllers/request/fetchAllRequests";
|
import PersonCreditsController from "./controllers/person/credits.js";
|
||||||
import RequestAllController from "./controllers/plex/fetchRequested";
|
import PersonInfoController from "./controllers/person/info.js";
|
||||||
import RequestInfoController from "./controllers/request/getRequest";
|
|
||||||
import RequestSubmitController from "./controllers/request/requestTmdbId";
|
|
||||||
|
|
||||||
import PirateSearchController from "./controllers/pirate/search";
|
import SeasonedAllController from "./controllers/seasoned/readStrays.js";
|
||||||
import PirateAddController from "./controllers/pirate/addMagnet";
|
import SeasonedInfoController from "./controllers/seasoned/strayById.js";
|
||||||
|
import SeasonedVerifyController from "./controllers/seasoned/verifyStray.js";
|
||||||
|
|
||||||
import GitDumpController from "./controllres/git/dump";
|
import PlexSearchController from "./controllers/plex/search.js";
|
||||||
import EmojiController from "./controllers/misc/emoji";
|
import PlexFetchRequestedController from "./controllers/plex/fetchRequested.js";
|
||||||
|
import PlexRequestsInfo from "./controllers/plex/updateRequested.js";
|
||||||
|
import PlexWatchLinkController from "./controllers/plex/watchDirectLink.js";
|
||||||
|
import PlexHookController from "./controllers/plex/hookDump.js";
|
||||||
|
import PlexSubmitRequestController from "./controllers/plex/submitRequest.js";
|
||||||
|
import PlexRequestInfo from "./controllers/plex/readRequest.js";
|
||||||
|
import PlexSearchRequestController from "./controllers/plex/searchRequest.js";
|
||||||
|
import PlexPlayingController from "./controllers/plex/plexPlaying.js";
|
||||||
|
import PlexSearchMediaController from "./controllers/plex/searchMedia.js";
|
||||||
|
import PlexUpdateRequestedController from "./controllers/plex/updateRequested.js";
|
||||||
|
|
||||||
|
import RequestFetchAllController from "./controllers/request/fetchAllRequests.js";
|
||||||
|
import RequestInfoController from "./controllers/request/getRequest.js";
|
||||||
|
import RequestSubmitController from "./controllers/request/requestTmdbId.js";
|
||||||
|
|
||||||
|
import PirateSearchController from "./controllers/pirate/searchTheBay.js";
|
||||||
|
import PirateAddController from "./controllers/pirate/addMagnet.js";
|
||||||
|
|
||||||
|
import GitDumpController from "./controllers/git/dumpHook.js";
|
||||||
|
import EmojiController from "./controllers/misc/emoji.js";
|
||||||
|
|
||||||
// TODO: Have our raven router check if there is a value, if not don't enable raven.
|
// TODO: Have our raven router check if there is a value, if not don't enable raven.
|
||||||
Raven.config(configuration.get("raven", "DSN")).install();
|
Raven.config(configuration.get("raven", "DSN")).install();
|
||||||
@@ -119,16 +121,8 @@ router.post("/v1/user", UserRegisterController);
|
|||||||
router.post("/v1/user/login", UserLoginController);
|
router.post("/v1/user/login", UserLoginController);
|
||||||
router.post("/v1/user/logout", UserLogoutController);
|
router.post("/v1/user/logout", UserLogoutController);
|
||||||
|
|
||||||
router.get(
|
router.get("/v1/user/settings", mustBeAuthenticated, getSettingsController);
|
||||||
"/v1/user/settings",
|
router.put("/v1/user/settings", mustBeAuthenticated, updateSettingsController);
|
||||||
mustBeAuthenticated,
|
|
||||||
SettingsController.getSettingsController
|
|
||||||
);
|
|
||||||
router.put(
|
|
||||||
"/v1/user/settings",
|
|
||||||
mustBeAuthenticated,
|
|
||||||
SettingsController.updateSettingsController
|
|
||||||
);
|
|
||||||
router.get(
|
router.get(
|
||||||
"/v1/user/search_history",
|
"/v1/user/search_history",
|
||||||
mustBeAuthenticated,
|
mustBeAuthenticated,
|
||||||
@@ -220,7 +214,7 @@ router.get("/v1/plex/watch-link", mustBeAuthenticated, PlexWatchLinkController);
|
|||||||
router.get("/v2/request", RequestFetchAllController);
|
router.get("/v2/request", RequestFetchAllController);
|
||||||
router.get("/v2/request/:id", RequestInfoController);
|
router.get("/v2/request/:id", RequestInfoController);
|
||||||
router.post("/v2/request", RequestSubmitController);
|
router.post("/v2/request", RequestSubmitController);
|
||||||
router.get("/v1/plex/requests/all", RequestAllController);
|
router.get("/v1/plex/requests/all", PlexFetchRequestedController);
|
||||||
router.put(
|
router.put(
|
||||||
"/v1/plex/request/:requestId",
|
"/v1/plex/request/:requestId",
|
||||||
mustBeAuthenticated,
|
mustBeAuthenticated,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import GitRepository from "../../../git/gitRepository";
|
import GitRepository from "../../../git/gitRepository.js";
|
||||||
|
|
||||||
const gitRepository = new GitRepository();
|
const gitRepository = new GitRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
@@ -51,17 +51,27 @@ function fetchTmdbList(req, res, listname, type) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const nowPlayingMovies = (req, res) =>
|
const nowPlayingMovies = (req, res) =>
|
||||||
fetchTmdbList(req, res, "miscNowPlayingMovies", "movie");
|
fetchTmdbList(req, res, "miscNowPlayingMovies", "movie");
|
||||||
export const popularMovies = (req, res) =>
|
const popularMovies = (req, res) =>
|
||||||
fetchTmdbList(req, res, "miscPopularMovies", "movie");
|
fetchTmdbList(req, res, "miscPopularMovies", "movie");
|
||||||
export const topRatedMovies = (req, res) =>
|
const topRatedMovies = (req, res) =>
|
||||||
fetchTmdbList(req, res, "miscTopRatedMovies", "movie");
|
fetchTmdbList(req, res, "miscTopRatedMovies", "movie");
|
||||||
export const upcomingMovies = (req, res) =>
|
const upcomingMovies = (req, res) =>
|
||||||
fetchTmdbList(req, res, "miscUpcomingMovies", "movie");
|
fetchTmdbList(req, res, "miscUpcomingMovies", "movie");
|
||||||
export const nowPlayingShows = (req, res) =>
|
const nowPlayingShows = (req, res) =>
|
||||||
fetchTmdbList(req, res, "tvOnTheAir", "show");
|
fetchTmdbList(req, res, "tvOnTheAir", "show");
|
||||||
export const popularShows = (req, res) =>
|
const popularShows = (req, res) =>
|
||||||
fetchTmdbList(req, res, "miscPopularTvs", "show");
|
fetchTmdbList(req, res, "miscPopularTvs", "show");
|
||||||
export const topRatedShows = (req, res) =>
|
const topRatedShows = (req, res) =>
|
||||||
fetchTmdbList(req, res, "miscTopRatedTvs", "show");
|
fetchTmdbList(req, res, "miscTopRatedTvs", "show");
|
||||||
|
|
||||||
|
export default {
|
||||||
|
nowPlayingMovies,
|
||||||
|
popularMovies,
|
||||||
|
topRatedMovies,
|
||||||
|
upcomingMovies,
|
||||||
|
nowPlayingShows,
|
||||||
|
popularShows,
|
||||||
|
topRatedShows
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Plex from "../../../plex/plex";
|
import Plex from "../../../plex/plex.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(Configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|
||||||
const personCreditsController = (req, res) => {
|
const personCreditsController = (req, res) => {
|
||||||
const personId = req.params.id;
|
const personId = req.params.id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
* @Last Modified time: 2017-10-21 15:32:43
|
* @Last Modified time: 2017-10-21 15:32:43
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import PirateRepository from "../../../pirate/pirateRepository";
|
import { AddMagnet } from "../../../pirate/pirateRepository.js";
|
||||||
|
|
||||||
function addMagnet(req, res) {
|
function addMagnet(req, res) {
|
||||||
const { magnet, name } = req.body;
|
const { magnet, name } = req.body;
|
||||||
const tmdbId = req.body?.tmdb_id;
|
const tmdbId = req.body?.tmdb_id;
|
||||||
|
|
||||||
PirateRepository.AddMagnet(magnet, name, tmdbId)
|
AddMagnet(magnet, name, tmdbId)
|
||||||
.then(result => res.send(result))
|
.then(result => res.send(result))
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
res.status(500).send({ success: false, message: error.message });
|
res.status(500).send({ success: false, message: error.message });
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @Last Modified time: 2018-02-26 19:56:32
|
* @Last Modified time: 2018-02-26 19:56:32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import PirateRepository from "../../../pirate/pirateRepository";
|
import { SearchPiratebay } from "../../../pirate/pirateRepository.js";
|
||||||
// const pirateRepository = new PirateRepository();
|
// const pirateRepository = new PirateRepository();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,7 +17,7 @@ import PirateRepository from "../../../pirate/pirateRepository";
|
|||||||
function updateRequested(req, res) {
|
function updateRequested(req, res) {
|
||||||
const { query, page, type } = req.query;
|
const { query, page, type } = req.query;
|
||||||
|
|
||||||
PirateRepository.SearchPiratebay(query, page, type)
|
SearchPiratebay(query, page, type)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
res.send({ success: true, results: result });
|
res.send({ success: true, results: result });
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import RequestRepository from "../../../plex/requestRepository";
|
import RequestRepository from "../../../plex/requestRepository.js";
|
||||||
|
|
||||||
const requestRepository = new RequestRepository();
|
const requestRepository = new RequestRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PlexRepository from "../../../plex/plexRepository";
|
import PlexRepository from "../../../plex/plexRepository.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
@@ -19,4 +19,4 @@ function playingController(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = playingController;
|
export default playingController;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import RequestRepository from "../../../plex/requestRepository";
|
import RequestRepository from "../../../plex/requestRepository.js";
|
||||||
|
|
||||||
const requestRepository = new RequestRepository();
|
const requestRepository = new RequestRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Plex from "../../../plex/plex";
|
import Plex from "../../../plex/plex.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PlexRepository from "../../../plex/plexRepository";
|
import PlexRepository from "../../../plex/plexRepository.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import SearchHistory from "../../../searchHistory/searchHistory";
|
import SearchHistory from "../../../searchHistory/searchHistory.js";
|
||||||
import Cache from "../../../tmdb/cache";
|
import Cache from "../../../tmdb/cache.js";
|
||||||
import RequestRepository from "../../../plex/requestRepository";
|
import RequestRepository from "../../../plex/requestRepository.js";
|
||||||
|
|
||||||
const cache = new Cache();
|
const cache = new Cache();
|
||||||
const requestRepository = new RequestRepository(cache);
|
const requestRepository = new RequestRepository(cache);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import RequestRepository from "../../../request/request";
|
import RequestRepository from "../../../request/request.js";
|
||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import RequestRepository from "../../../plex/requestRepository";
|
import RequestRepository from "../../../plex/requestRepository.js";
|
||||||
|
|
||||||
const requestRepository = new RequestRepository();
|
const requestRepository = new RequestRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Plex from "../../../plex/plex";
|
import Plex from "../../../plex/plex.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const plex = new Plex(configuration.get("plex", "ip"));
|
const plex = new Plex(configuration.get("plex", "ip"));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import RequestRepository from "../../../request/request";
|
import RequestRepository from "../../../request/request.js";
|
||||||
|
|
||||||
const request = new RequestRepository();
|
const request = new RequestRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import RequestRepository from "../../../request/request";
|
import RequestRepository from "../../../request/request.js";
|
||||||
|
|
||||||
const request = new RequestRepository();
|
const request = new RequestRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import RequestRepository from "../../../request/request";
|
import RequestRepository from "../../../request/request.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import SearchHistory from "../../../searchHistory/searchHistory";
|
import SearchHistory from "../../../searchHistory/searchHistory.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import SearchHistory from "../../../searchHistory/searchHistory";
|
import SearchHistory from "../../../searchHistory/searchHistory.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import SearchHistory from "../../../searchHistory/searchHistory";
|
import SearchHistory from "../../../searchHistory/searchHistory.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import SearchHistory from "../../../searchHistory/searchHistory";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import TMDB from "../../../tmdb/tmdb";
|
import SearchHistory from "../../../searchHistory/searchHistory.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import StrayRepository from "../../../seasoned/strayRepository";
|
import StrayRepository from "../../../seasoned/strayRepository.js";
|
||||||
|
|
||||||
const strayRepository = new StrayRepository();
|
const strayRepository = new StrayRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import StrayRepository from "../../../seasoned/strayRepository";
|
import StrayRepository from "../../../seasoned/strayRepository.js";
|
||||||
|
|
||||||
const strayRepository = new StrayRepository();
|
const strayRepository = new StrayRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import StrayRepository from "../../../seasoned/strayRepository";
|
import StrayRepository from "../../../seasoned/strayRepository.js";
|
||||||
|
|
||||||
const strayRepository = new StrayRepository();
|
const strayRepository = new StrayRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TMDB from "../../../tmdb/tmdb";
|
import TMDB from "../../../tmdb/tmdb.js";
|
||||||
import Plex from "../../../plex/plex";
|
import Plex from "../../../plex/plex.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import FormData from "form-data";
|
import FormData from "form-data";
|
||||||
import UserRepository from "../../../user/userRepository";
|
import UserRepository from "../../../user/userRepository.js";
|
||||||
|
|
||||||
const userRepository = new UserRepository();
|
const userRepository = new UserRepository();
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ function plexAuthenticate(username, password) {
|
|||||||
return fetch(url, options).then(resp => handleResponse(resp));
|
return fetch(url, options).then(resp => handleResponse(resp));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function link(req, res) {
|
function link(req, res) {
|
||||||
const user = req.loggedInUser;
|
const user = req.loggedInUser;
|
||||||
const { username, password } = req.body;
|
const { username, password } = req.body;
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ export function link(req, res) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unlink(req, res) {
|
function unlink(req, res) {
|
||||||
const username = req.loggedInUser ? req.loggedInUser.username : null;
|
const username = req.loggedInUser ? req.loggedInUser.username : null;
|
||||||
|
|
||||||
return userRepository
|
return userRepository
|
||||||
@@ -108,3 +108,5 @@ export function unlink(req, res) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default { link, unlink };
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import User from "../../../user/user";
|
import User from "../../../user/user.js";
|
||||||
import Token from "../../../user/token";
|
import Token from "../../../user/token.js";
|
||||||
import UserSecurity from "../../../user/userSecurity";
|
import UserSecurity from "../../../user/userSecurity.js";
|
||||||
import UserRepository from "../../../user/userRepository";
|
import UserRepository from "../../../user/userRepository.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const secret = configuration.get("authentication", "secret");
|
const secret = configuration.get("authentication", "secret");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import User from "../../../user/user";
|
import User from "../../../user/user.js";
|
||||||
import Token from "../../../user/token";
|
import Token from "../../../user/token.js";
|
||||||
import UserSecurity from "../../../user/userSecurity";
|
import UserSecurity from "../../../user/userSecurity.js";
|
||||||
import Configuration from "../../../config/configuration";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const secret = configuration.get("authentication", "secret");
|
const secret = configuration.get("authentication", "secret");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import RequestRepository from "../../../plex/requestRepository";
|
import RequestRepository from "../../../plex/requestRepository.js";
|
||||||
|
|
||||||
const requestRepository = new RequestRepository();
|
const requestRepository = new RequestRepository();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import SearchHistory from "../../../searchHistory/searchHistory";
|
import SearchHistory from "../../../searchHistory/searchHistory.js";
|
||||||
|
|
||||||
const searchHistory = new SearchHistory();
|
const searchHistory = new SearchHistory();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import UserRepository from "../../../user/userRepository";
|
import UserRepository from "../../../user/userRepository.js";
|
||||||
|
|
||||||
const userRepository = new UserRepository();
|
const userRepository = new UserRepository();
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import configuration from "../../../config/configuration";
|
import Tautulli from "../../../tautulli/tautulli.js";
|
||||||
import Tautulli from "../../../tautulli/tautulli";
|
import Configuration from "../../../config/configuration.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const apiKey = configuration.get("tautulli", "apiKey");
|
const apiKey = configuration.get("tautulli", "apiKey");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import establishedDatabase from "../../database/database";
|
import establishedDatabase from "../../database/database.js";
|
||||||
|
|
||||||
// eslint-disable-next-line consistent-return
|
// eslint-disable-next-line consistent-return
|
||||||
const mustBeAdmin = (req, res, next) => {
|
const mustBeAdmin = (req, res, next) => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import establishedDatabase from "../../database/database";
|
import establishedDatabase from "../../database/database.js";
|
||||||
|
|
||||||
/* eslint-disable consistent-return */
|
/* eslint-disable consistent-return */
|
||||||
const mustHaveAccountLinkedToPlex = (req, res, next) => {
|
const mustHaveAccountLinkedToPlex = (req, res, next) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
import Configuration from "../../config/configuration";
|
import Configuration from "../../config/configuration.js";
|
||||||
import Token from "../../user/token";
|
import Token from "../../user/token.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
const secret = configuration.get("authentication", "secret");
|
const secret = configuration.get("authentication", "secret");
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import Configuration from "../config/configuration";
|
import Configuration from "../config/configuration.js";
|
||||||
import app from "./app";
|
import app from "./app.js";
|
||||||
|
|
||||||
const configuration = Configuration.getInstance();
|
const configuration = Configuration.getInstance();
|
||||||
|
|
||||||
export default app.listen(config.get("webserver", "port"), () => {
|
export default app.listen(configuration.get("webserver", "port"), () => {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
console.log("seasonedAPI");
|
console.log("seasonedAPI");
|
||||||
console.log(`Database is located at ${config.get("database", "host")}`);
|
console.log(
|
||||||
console.log(`Webserver is listening on ${config.get("webserver", "port")}`);
|
`Database is located at ${configuration.get("database", "host")}`
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
`Webserver is listening on ${configuration.get("webserver", "port")}`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user