From 2eef558ba31d4bc918e06e19ef868326d2c61a8f Mon Sep 17 00:00:00 2001 From: IrosTheBeggar Date: Mon, 4 Jun 2018 02:12:17 -0400 Subject: [PATCH] Update docs --- docs/cli_arguments.md | 8 ++++++++ docs/json_config.md | 8 +++++--- modules/configure-json-file.js | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/cli_arguments.md b/docs/cli_arguments.md index 3be42af..eb8f56e 100644 --- a/docs/cli_arguments.md +++ b/docs/cli_arguments.md @@ -69,6 +69,14 @@ mStream automatically makes a DB file in the folder of the directory it is run f mstream -d /path/to/mstream.db ``` +## DB Scan Interval + +By default, mStream will scan all your files every 24 to update the DB. If you want to change that you can set the interval with `-E`. The interval can only be set in hours. Set this to 0 to turn off interval scanning + +``` +mstream -E 2 +``` + ## Automatically setup port forwarding mStream can try to automatically setup port forwarding via upnp. Use the '-t' command to try to setup port forwarding. diff --git a/docs/json_config.md b/docs/json_config.md index 4f3373f..36aaed8 100644 --- a/docs/json_config.md +++ b/docs/json_config.md @@ -8,7 +8,8 @@ Using a JSON config with mStream allows for more advanced configurations. This "userinterface":"public", "secret": "b6j7j5e6u5g36ubn536uyn536unm5m67u5365vby435y54ymn", "database_plugin":{ - "dbPath":"/path/to/loki.db" + "dbPath":"/path/to/loki.db", + "interval": 2 }, "albumArtDir": "/media/album-art", "folders": { @@ -55,11 +56,12 @@ Sets the secret key used for the login system. If this is not set, mStream will ## Database -This option is a relic of the past when mStream also supported SQLite. Right now only the path can be set. This defaults to the current working directory +Set DB options here. You can set the path for the DB and the scan interval. Scan interval is set in hours. If you want to use a decimal for the scan interval, you need to put quotes around it ``` "database_plugin":{ - "dbPath":"/path/to/loki.db" + "dbPath":"/path/to/loki.db", + "interval": "1.5" }, ``` diff --git a/modules/configure-json-file.js b/modules/configure-json-file.js index 244cae6..5d86341 100644 --- a/modules/configure-json-file.js +++ b/modules/configure-json-file.js @@ -28,7 +28,8 @@ exports.setup = function (loadJson, rootDir) { loadJson.database_plugin.interval = 0; } - if (typeof loadJson.database_plugin.interval !== 'number' || loadJson.database_plugin.interval < 0) { + loadJson.database_plugin.interval = Number(loadJson.database_plugin.interval); + if (typeof loadJson.database_plugin.interval !== 'number' || isNaN(loadJson.database_plugin.interval) || loadJson.database_plugin.interval < 0) { loadJson.database_plugin.interval = 24; }