Skip to content

Commit

Permalink
Reworked library refresh implementation #3
Browse files Browse the repository at this point in the history
Some fixes
  • Loading branch information
softworkz committed Oct 20, 2015
1 parent 298ca71 commit a1f9104
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions MediaBrowser.Server.Implementations/IO/LibraryUpdateQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,16 @@ public void AddPath(string path)
string folder;
string filePath;

var fi =_fileSystem.GetFileInfo(path);
var fsMeta =_fileSystem.GetFileSystemInfo(path);

if (!fi.IsDirectory)
if (!fsMeta.IsDirectory)
{
var fileInfo = _fileSystem.GetFileInfo(path);
folder = fileInfo.DirectoryName.ToLower();
filePath = fileInfo.FullName.ToLower();
folder = fsMeta.DirectoryName.ToLower();
filePath = fsMeta.FullName.ToLower();
}
else
{
var dirInfo = _fileSystem.GetDirectoryInfo(path);
folder = dirInfo.FullName.ToLower();
folder = fsMeta.FullName.ToLower();
filePath = string.Empty;
}

Expand Down Expand Up @@ -133,6 +131,11 @@ private void UpdateTimer()
var nextTimerTime = _internalQueue.Min(e => e.Value.DueDate);
var nextTimerSpan = nextTimerTime.AddSeconds(1).Subtract(DateTime.Now);

if (nextTimerSpan < TimeSpan.FromSeconds(1))
{
nextTimerSpan = TimeSpan.FromSeconds(1);
}

SetTimer(nextTimerSpan);
}

Expand Down

0 comments on commit a1f9104

Please sign in to comment.