Skip to content

Commit

Permalink
Check file time, fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
poma committed Sep 6, 2017
1 parent e20099f commit a6848ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Hotsapi.Uploader.Common/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ private async Task UploadLoop()
var monitor = new Monitor();

var replays = _storage.Load().ToList();
var filenames = new HashSet<string>(replays.Select(x => x.Filename));
replays.AddRange(monitor.ScanReplays().Where(x => !filenames.Contains(x)).Select(x => new ReplayFile(x)));
var filenames = replays.ToDictionary(x => x.Filename);
replays.AddRange(monitor.ScanReplays()
.Where(x => !filenames.ContainsKey(x))
.Select(x => new ReplayFile(x))
.Where(x => x.Created != filenames[x.Filename].Created)
);
replays.OrderByDescending(x => x.Created).Map(x => Files.Add(x));

monitor.ReplayAdded += async (_, e) => {
Expand Down
4 changes: 2 additions & 2 deletions Hotsapi.Uploader.Windows/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]

0 comments on commit a6848ed

Please sign in to comment.