2024-12-03 17:46:43 -05:00
|
|
|
const config = require('config');
|
|
|
|
|
|
|
|
const configuration = {
|
|
|
|
plex: {
|
|
|
|
url: null,
|
|
|
|
token: null
|
|
|
|
},
|
|
|
|
scrobble: {
|
2024-12-03 18:58:15 -05:00
|
|
|
minimum: {
|
|
|
|
percent: null,
|
|
|
|
duration: null
|
|
|
|
},
|
|
|
|
plex: {
|
|
|
|
delay: null,
|
|
|
|
filters: []
|
|
|
|
/* A filter will have the following properties:
|
|
|
|
library: [""],
|
|
|
|
ip: [""],
|
|
|
|
deviceId: [""],
|
|
|
|
platform: [""],
|
|
|
|
product: [""]
|
|
|
|
*/
|
|
|
|
},
|
2024-12-03 17:46:43 -05:00
|
|
|
},
|
|
|
|
web: {
|
|
|
|
host: null,
|
|
|
|
port: null
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
if (config.has("plex.url"))
|
|
|
|
configuration.plex.url = config.get("plex.url");
|
|
|
|
if (config.has("plex.token"))
|
|
|
|
configuration.plex.token = config.get("plex.token");
|
|
|
|
|
2024-12-03 18:58:15 -05:00
|
|
|
if (config.has("scrobble.plex.delay"))
|
|
|
|
configuration.scrobble.plex.delay = config.get("scrobble.plex.delay");
|
|
|
|
if (config.has("scrobble.plex.filters"))
|
|
|
|
configuration.scrobble.plex.filters = config.get("scrobble.plex.filters");
|
|
|
|
|
|
|
|
if (config.has("scrobble.minimum.duration"))
|
|
|
|
configuration.scrobble.minimum.duration = config.get("scrobble.minimum.duration");
|
|
|
|
if (config.has("scrobble.minimum.percent"))
|
|
|
|
configuration.scrobble.minimum.percent = config.get("scrobble.minimum.percent");
|
2024-12-03 17:46:43 -05:00
|
|
|
|
|
|
|
if (config.has("web.host"))
|
|
|
|
configuration.web.host = config.get("web.host");
|
|
|
|
if (config.has("web.port"))
|
|
|
|
configuration.web.port = config.get("web.port");
|
|
|
|
|
|
|
|
module.exports = configuration;
|