update offline detection

This commit is contained in:
Luke Pulverenti
2015-09-21 11:43:10 -04:00
parent f2689c4a5a
commit e90072b75f
2 changed files with 19 additions and 10 deletions

View File

@@ -184,15 +184,24 @@ namespace MediaBrowser.Server.Implementations.Persistence
try
{
if (!_fileSystem.FileExists(path) && !_fileSystem.DirectoryExists(path))
if (_fileSystem.FileExists(path) || _fileSystem.DirectoryExists(path))
{
var libraryItem = _libraryManager.GetItemById(item.Item1);
await _libraryManager.DeleteItem(libraryItem, new DeleteOptions
{
DeleteFileLocation = false
});
continue;
}
var libraryItem = _libraryManager.GetItemById(item.Item1);
if (Folder.IsPathOffline(path))
{
libraryItem.IsOffline = true;
await libraryItem.UpdateToRepository(ItemUpdateType.None, cancellationToken).ConfigureAwait(false);
continue;
}
await _libraryManager.DeleteItem(libraryItem, new DeleteOptions
{
DeleteFileLocation = false
});
}
catch (OperationCanceledException)
{