Skip to content

Commit

Permalink
Adding option to download all files as per #3
Browse files Browse the repository at this point in the history
  • Loading branch information
AndMu committed Dec 16, 2017
1 parent ea0440a commit 99053d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/YiScanner/Monitoring/MonitoringConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class MonitoringConfig : IMonitoringConfig
{
public int Scan { get; set; }

public bool All { get; set; }

public string Cameras { get; set; }

public string Hosts { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion src/YiScanner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ private static void StartService(string directory, FtpConfiguration ftpConfigura
}

MonitoringConfig config = JsonConvert.DeserializeObject<MonitoringConfig>(File.ReadAllText(Path.Combine(directory, "service.json")));
DestinationFactory factory = new DestinationFactory(ftpConfiguration, config, new NewFilesPredicate());
var predicate = config.All ? new NullPredicate() : (IPredicate)new NewFilesPredicate();
DestinationFactory factory = new DestinationFactory(ftpConfiguration, config, predicate);
HostFactory.Run(x =>
{
x.Service<MonitoringInstance>(s =>
Expand Down

0 comments on commit 99053d9

Please sign in to comment.