Skip to content

Commit

Permalink
Fixed sample settings
Browse files Browse the repository at this point in the history
Fixed ForceImport ignoring settings on ScanOnStart
# Sonarr Scanner
Fixed ScanOnStart not running when both 'ScanOnWake' and 'ScanOnInterval' is false
Removed delay from the startup, that was not needed.
  • Loading branch information
Uilton Oliveira committed Sep 7, 2020
1 parent 89f35c4 commit c981fe5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ Keep monitoring the Sonarr and Radarr wanted list and send an search request to

The software was completly rewritten to .NET Core (cross platform)

To start using it, you just need to configure "settings_sonarr.json" and/or "settings_radarr.json", make sure to put the correect API Key. Examples are provided as "settings_sonarr.json.sample" / "settings_radarr.json.sample".
## Settings

To start using it, you just need to configure **'settings_sonarr.json'** and/or **'settings_radarr.json'**, make sure to put the correect API Key.

Examples are provided as **'settings_sonarr.json.sample'** / **'settings_radarr.json.sample'**.

If the setting **'ScanOnStart'** is **true**, and both **'ScanOnWake'** and **'ScanOnInterval'** is **false**, it will start, scan and exit the app, otherwise it will stay open.

All the interval properties is in minutes.

## Running on Docker
You can omit sonarr or radarr and use only one of then if you wish.
```sh
docker run -it --rm \
-v /path/to/settings_sonarr.json:/app/settings_sonarr.json:ro \
Expand Down
5 changes: 1 addition & 4 deletions settings_radarr.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"Interval": 30,
"ScanOnWake": true,
"ScanOnInterval": false,
"ScanOnStart": true,
"ForceImport": false,
"ForceImportInterval": 1,
"ForceImportMode": "Copy",
"ScanOnStart": true
"APIKey": ""
}
5 changes: 1 addition & 4 deletions settings_sonarr.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"Interval": 30,
"ScanOnWake": true,
"ScanOnInterval": false,
"ScanOnStart": true, "Interval": 30,
"ScanOnWake": true,
"ScanOnInterval": false,
"ScanOnStart": true,
"ScanOnStart": true,
"ForceImport": false,
"ForceImportInterval": 1,
"ForceImportMode": "Copy",
Expand Down
5 changes: 3 additions & 2 deletions src/Monitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ public bool Init()
{
Console.WriteLine("Startup Scan started.");
Scan();
ForceImport();
if (Settings.ForceImport)
ForceImport();
}
);
thread.Start();
}

return Settings.ScanOnWake || Settings.ScanOnInterval;
return Settings.ScanOnWake || Settings.ScanOnInterval || Settings.ScanOnStart;
}

private void ForceImport()
Expand Down
3 changes: 0 additions & 3 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ private static void Main(string[] args)
Exit();
}

Task.Delay(TimeSpan.FromMinutes(1), cancellationTokenSource.Token);


}

private static void Exit()
Expand Down

0 comments on commit c981fe5

Please sign in to comment.