diff --git a/NzbDrone.Api/Frontend/StaticResourceProvider.cs b/NzbDrone.Api/Frontend/StaticResourceProvider.cs index a3334edc8..66bbaaedf 100644 --- a/NzbDrone.Api/Frontend/StaticResourceProvider.cs +++ b/NzbDrone.Api/Frontend/StaticResourceProvider.cs @@ -35,20 +35,20 @@ public Response ProcessStaticResourceRequest(NancyContext context, string workin return null; } - foreach (var requestMapper in _requestMappers) - { - if (requestMapper.CanHandle(path)) - { - var filePath = requestMapper.Map(path); + var mapper = _requestMappers.SingleOrDefault(m => m.CanHandle(path)); - if (_diskProvider.FileExists(filePath)) - { - return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath)); - } + if (mapper != null) + { + var filePath = mapper.Map(path); + + if (_diskProvider.FileExists(filePath)) + { + return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath)); } + + _logger.Warn("File {0} not found", filePath); } - _logger.Warn("Couldn't find a matching file for: {0}", path); return null; } } diff --git a/NzbDrone.Core/Update/UpdateService.cs b/NzbDrone.Core/Update/UpdateService.cs index a0a716b4e..bfde1c213 100644 --- a/NzbDrone.Core/Update/UpdateService.cs +++ b/NzbDrone.Core/Update/UpdateService.cs @@ -81,6 +81,8 @@ private void InstallUpdate(UpdatePackage updatePackage) var process = _processProvider.Start(startInfo); _processProvider.WaitForExit(process); + + _logger.Error("Update process failed"); } public Dictionary GetUpdateLogFiles() diff --git a/NzbDrone.Update/Providers/UpdateProvider.cs b/NzbDrone.Update/Providers/UpdateProvider.cs index e56215fcd..2837130c3 100644 --- a/NzbDrone.Update/Providers/UpdateProvider.cs +++ b/NzbDrone.Update/Providers/UpdateProvider.cs @@ -81,9 +81,6 @@ public virtual void Start(string targetFolder) try { _diskProvider.CopyDirectory(_environmentProvider.GetUpdatePackageFolder(), targetFolder); - - logger.Trace("Deleting Update Package."); - _diskProvider.DeleteFolder(_environmentProvider.GetUpdatePackageFolder(), true); } catch (Exception e) {