const config = require('config'); const configuration = { plex: { url: null, token: null }, scrobble: { minimum: { percent: null, duration: null }, plex: { delay: null, filters: [] /* A filter will have the following properties: library: [""], ip: [""], deviceId: [""], platform: [""], product: [""] */ }, }, 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"); 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"); 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;